comparison stream/stream_bd.c @ 31915:c1e009d855b5

Avoid another unnecessary intermediate variable.
author reimar
date Sat, 21 Aug 2010 09:58:02 +0000
parents 579d0c6b4270
children 6b45e5fb9dc4
comparison
equal deleted inserted replaced
31914:579d0c6b4270 31915:c1e009d855b5
161 id2str(discid, 20, idstr); 161 id2str(discid, 20, idstr);
162 while (!stream_eof(file)) { 162 while (!stream_eof(file)) {
163 int i; 163 int i;
164 char line[1024]; 164 char line[1024];
165 char *vst; 165 char *vst;
166 unsigned int byte;
167 166
168 stream_read_line(file, line, sizeof(line), 0); 167 stream_read_line(file, line, sizeof(line), 0);
169 // file is built up this way: 168 // file is built up this way:
170 // DISCID = title | V | VUK 169 // DISCID = title | V | VUK
171 // or 170 // or
186 vst += 6; 185 vst += 6;
187 while (isspace(*vst)) vst++; 186 while (isspace(*vst)) vst++;
188 if (strlen(vst) < 32) 187 if (strlen(vst) < 32)
189 continue; 188 continue;
190 for (i = 0; i < 16; i++) { 189 for (i = 0; i < 16; i++) {
191 if (sscanf(&vst[i*2], "%2x", &byte) != 1) 190 if (sscanf(&vst[i*2], "%2"SCNx8, &bd->vuk.u8[i]) != 1)
192 break; 191 break;
193 bd->vuk.u8[i] = byte;
194 } 192 }
195 vukfound = 1; 193 vukfound = 1;
196 } 194 }
197 free_stream(file); 195 free_stream(file);
198 return vukfound; 196 return vukfound;