snd_umx.c (read_typname): made technically more correct (not that it matters for our case, but still..)

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@879 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
sezero 2013-10-24 07:03:49 +00:00
parent 98d172fbaf
commit 98c8d0426a
1 changed files with 3 additions and 3 deletions

View File

@ -201,15 +201,15 @@ static int read_typname(fshandle_t *f, const struct upkg_hdr *hdr,
char buf[64];
if (idx >= hdr->name_count) return -1;
buf[63] = '\0';
for (i = 0, l = 0; i <= idx; i++) {
FS_fseek(f, hdr->name_offset + l, SEEK_SET);
FS_fread(buf, 1, 64, f);
FS_fread(buf, 1, 63, f);
if (hdr->file_version >= 64) {
s = *(signed char *)buf; /* numchars *including* terminator */
if (s <= 0 || s >= 64) return -1;
if (s <= 0 || s > 64) return -1;
l += s + 5; /* 1 for buf[0], 4 for int32_t name_flags */
} else {
buf[63] = 0;
l += (long)strlen(buf);
l += 5; /* 1 for terminator, 4 for int32_t name_flags */
}