Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dsktool/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 3 additions & 4 deletions dsktool/dsktool.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <stdint.h>
#include <unistd.h>
#include <ctype.h>
#include <malloc.h>
#include <string.h>
#include <time.h>
#include <libgen.h>
Expand Down Expand Up @@ -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++;
}

Expand Down Expand Up @@ -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("");
Expand Down Expand Up @@ -656,7 +655,7 @@ void add_single_file(char *name, char *pathname) {
//Search first empty directory entry
dir = rootdir;
for (i=0; i<bootsec->maxDirectoryEntries; i++) {
if (dir->name[0]<0x20 || dir->name[0]>=0x80) {
if (dir->name[0]<0x20 || (dir->name[0] & 0x80)) {
break;
}
dir++;
Expand Down