When I make a simple call to strcmp(), nothing comes back. I try to print the return value and it prints nothing as if there is nothing in the variable. It doesn't print garbage data, it literally prints nothing. Here is the relevant piece of code:
Code: Select all
FILE file;
unsigned char *buf;
PDIRECTORY directory;
char dosFileName[11];
to_dos_file_name(directoryName, dosFileName, 11);
dosFileName[11] = 0; // null terminate
for (int sector = 0; sector < 14; sector++) {
// read sector
buf = (unsigned char *)flpy_read_sector(mount_info.rootOffset + sector);
directory = (PDIRECTORY)buf;
// 16 entries per sector
for (int i = 0; i < 16; i++) {
// get current filename
char name[11];
memcpy(name, directory->filename, 11);
name[11] = 0;
// does it match?
if (!strcmp(dosFileName, name)) { // if I print this value, nothing shows up