fscanf bugfixes

This commit is contained in:
Enno Rehling 2002-04-14 08:00:49 +00:00
parent 166b347aeb
commit 776fb980db
3 changed files with 3 additions and 3 deletions

View File

@ -109,7 +109,7 @@ read_borders(FILE * f)
fscanf(f, "%d %d %d %d ", &fx, &fy, &tx, &ty); fscanf(f, "%d %d %d %d ", &fx, &fy, &tx, &ty);
bid = ++nextborder; bid = ++nextborder;
} else { } else {
fscanf(f, "%ud %d %d %d %d", &bid, &fx, &fy, &tx, &ty); fscanf(f, "%u %d %d %d %d", &bid, &fx, &fy, &tx, &ty);
} }
type = find_bordertype(zText); type = find_bordertype(zText);
assert(type || !"border type not registered"); assert(type || !"border type not registered");

View File

@ -2432,7 +2432,7 @@ rt_read(FILE * F)
{ {
resource_type * rt = calloc(sizeof(resource_type), 1); resource_type * rt = calloc(sizeof(resource_type), 1);
unsigned int hash; unsigned int hash;
int i = fscanf(F, "%ud\n", &hash); int i = fscanf(F, "%u\n", &hash);
if (i==0 || i==EOF) { if (i==0 || i==EOF) {
free(rt); free(rt);
return NULL; return NULL;

View File

@ -36,7 +36,7 @@ log_read(const char * filename)
char buf[64]; char buf[64];
while (*fp) fp=&(*fp)->next; while (*fp) fp=&(*fp)->next;
fscanf(log, "LOGVERSION %ud\n", &global.data_version); fscanf(log, "LOGVERSION %u\n", &global.data_version);
while (!feof(log)) { while (!feof(log)) {
if(fscanf(log, "%s", buf) == EOF) break; if(fscanf(log, "%s", buf) == EOF) break;
if (strcmp(buf, "UNIT")==0) { if (strcmp(buf, "UNIT")==0) {