mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
Fix some snafus in PL_ParseData
Found them by inspection while writing a python version of qfplist.
This commit is contained in:
parent
196f2da585
commit
561484842c
1 changed files with 6 additions and 5 deletions
|
@ -478,16 +478,17 @@ make_byte (byte h, byte l)
|
|||
static char *
|
||||
PL_ParseData (pldata_t *pl, int *len)
|
||||
{
|
||||
unsigned int start = ++pl->pos;
|
||||
int nibbles = 0, i;
|
||||
char *str;
|
||||
unsigned start = ++pl->pos;
|
||||
int nibbles = 0, i;
|
||||
char *str, c;
|
||||
|
||||
while (pl->pos < pl->end) {
|
||||
if (isxdigit (pl->ptr[pl->pos])) {
|
||||
c = pl->ptr[pl->pos++];
|
||||
if (isxdigit (c)) {
|
||||
nibbles++;
|
||||
continue;
|
||||
}
|
||||
if (pl->ptr[pl->pos] == '>') {
|
||||
if (c == '>') {
|
||||
if (nibbles & 1) {
|
||||
pl->error = "invalid data, missing nibble";
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in a new issue