make error reporting a little saner (hopefully)

This commit is contained in:
Bill Currie 2002-10-31 23:00:13 +00:00
parent 7af99f422f
commit 1a6a9f177d

View file

@ -71,10 +71,12 @@ pack_open (const char *name)
if (Qread (pack->handle, &pack->header, sizeof (pack->header))
!= sizeof (pack->header)) {
fprintf (stderr, "%s: not a pack file\n", name);
errno = 0;
goto error;
}
if (strncmp (pack->header.id, "PACK", 4)) {
fprintf (stderr, "%s: not a pack file\n", name);
errno = 0;
goto error;
}
@ -86,7 +88,7 @@ pack_open (const char *name)
pack->files = malloc (pack->files_size * sizeof (dpackfile_t));
if (!pack->files) {
fprintf (stderr, "out of memory\n");
//fprintf (stderr, "out of memory\n");
goto error;
}
Qseek (pack->handle, pack->header.dirofs, SEEK_SET);