mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-13 07:21:31 +00:00
snd_umx.c (read_typname): made technically more correct (not that it matters for our case, but still..)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@879 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
8d6e912c2a
commit
8060407875
1 changed files with 3 additions and 3 deletions
|
@ -201,15 +201,15 @@ static int read_typname(fshandle_t *f, const struct upkg_hdr *hdr,
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
||||||
if (idx >= hdr->name_count) return -1;
|
if (idx >= hdr->name_count) return -1;
|
||||||
|
buf[63] = '\0';
|
||||||
for (i = 0, l = 0; i <= idx; i++) {
|
for (i = 0, l = 0; i <= idx; i++) {
|
||||||
FS_fseek(f, hdr->name_offset + l, SEEK_SET);
|
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) {
|
if (hdr->file_version >= 64) {
|
||||||
s = *(signed char *)buf; /* numchars *including* terminator */
|
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 */
|
l += s + 5; /* 1 for buf[0], 4 for int32_t name_flags */
|
||||||
} else {
|
} else {
|
||||||
buf[63] = 0;
|
|
||||||
l += (long)strlen(buf);
|
l += (long)strlen(buf);
|
||||||
l += 5; /* 1 for terminator, 4 for int32_t name_flags */
|
l += 5; /* 1 for terminator, 4 for int32_t name_flags */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue