Use int instead of long to count elements in Z80.

This commit is contained in:
2021-05-25 21:51:48 +01:00
parent 2ac584e5c2
commit 9913136690
2 changed files with 5 additions and 5 deletions

View File

@@ -36,7 +36,7 @@ void DirectoryDepth(const char* path)
#ifdef USE_FOLDERS
int ret;
char filename[9];
long pos = 0;
int pos = 0;
printf("\nPlease insert the \"DEPTH\" disk.\n");
printf("Press Y to continue,\n");
@@ -48,7 +48,7 @@ void DirectoryDepth(const char* path)
while(!ret)
{
memset(filename, 0, 9);
sprintf(filename, "%08ld", pos);
sprintf(filename, "%08d", pos);
ret = mkdir(filename, 0755);
if(!ret) ret = chdir(filename);
@@ -59,6 +59,6 @@ void DirectoryDepth(const char* path)
if(pos >= 1000) break;
}
printf("\tCreated %ld levels of directory hierarchy\n", pos);
printf("\tCreated %d levels of directory hierarchy\n\n", pos);
#endif
}

View File

@@ -30,7 +30,7 @@ Copyright (C) 2011-2021 Natalia Portillo
void MillionFiles(const char* path)
{
char filename[9];
long pos = 0;
int pos;
FILE* h;
int ret;
@@ -54,5 +54,5 @@ void MillionFiles(const char* path)
fclose(h);
}
printf("\tCreated %ld files\n", pos);
printf("\tCreated %d files\n\n", pos);
}