Browse Source

* Fix infinite loop due to signed/unsigned mistake.

tags/v0.99.beta14
Sam Hocevar sam 18 years ago
parent
commit
ba605528cc
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      test/swallow.c

+ 6
- 1
test/swallow.c View File

@@ -28,7 +28,7 @@ int main(int argc, char **argv)
static cucul_canvas_t *cv, *app;
static caca_display_t *dp;
unsigned char *buf[2];
unsigned long int bytes[2], total[2];
long int bytes[2], total[2];
FILE *f[2];
int w, h, i;

@@ -86,6 +86,11 @@ int main(int argc, char **argv)
fread(buf[i] + total[i], 128, 1, f[i]);
total[i] += 128;
}
else
{
fprintf(stderr, "%s: corrupted input\n", argv[0]);
return -1;
}
}
}



Loading…
Cancel
Save