diff --git a/dsktool/Makefile b/dsktool/Makefile index 5366a4a..7c4f001 100644 --- a/dsktool/Makefile +++ b/dsktool/Makefile @@ -1,7 +1,7 @@ -CC=g++ +CC=cc #CC=i686-w64-mingw32-g++ #FLAGS32=-m32 -STATIC=-static -static-libgcc -static-libstdc++ +#STATIC=-static -static-libgcc -static-libstdc++ CCFLAGS=$(FLAGS32) $(STATIC) -Wall -O2 -fpermissive -Wunused-variable OUT=dsktool #OUT=dsktool.exe diff --git a/dsktool/dsktool.c b/dsktool/dsktool.c index aed1b85..de85a8f 100644 --- a/dsktool/dsktool.c +++ b/dsktool/dsktool.c @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -292,7 +291,7 @@ fileinfo_t *getfileinfo (uint16_t entrypos) { // Filter entries by name char *name = (char *)dir->name; for (i=0; i<11; i++) { - if (*name < 0x20 || *name >= 0x80) return NULL; + if (*name < 0x20 || (*name & 0x80)) return NULL; name++; } @@ -416,7 +415,7 @@ void list_advhdsk (void) { printf ("Name of volume: %s\n\n",name); for (i=0; i<190; i++) { file = getfileinfoadvh(i); - if (file->name[0]==0xFF) break; + if ((unsigned char)file->name[0]==0xFF) break; printf ("%-8s.%-3s [Diskfile Offset:%7d] %7u bytes\n", file->name, file->ext, file->first, file->size); } puts(""); @@ -656,7 +655,7 @@ void add_single_file(char *name, char *pathname) { //Search first empty directory entry dir = rootdir; for (i=0; imaxDirectoryEntries; i++) { - if (dir->name[0]<0x20 || dir->name[0]>=0x80) { + if (dir->name[0]<0x20 || (dir->name[0] & 0x80)) { break; } dir++;