int compare_filenames(char* data, char* filename){
//note: we only have 31 directory/file entries within a block
int i;
int offset;
//printf("argument %s\n", filename);
for(i = 0; i < BLOCK_SIZE; i+=16){
if(strcmp(filename, &data[i])){
offset = i + 12;
return data[i+12];// double check here
}
}
return ERR_FILE_NOT_FOUND; //didn't find it within
}
最初の要素が最初にある場合でも、いくつかの理由で strcmp は 2 つのループ反復を通過します。