mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-23 20:33:05 +00:00
Fixed all invalid mmeory accesses
This commit is contained in:
parent
b09d75518c
commit
1d6594a491
3 changed files with 6 additions and 12 deletions
4
asm.c
4
asm.c
|
@ -161,10 +161,6 @@ static inline bool asm_parse_func(const char *skip, size_t line, asm_state *stat
|
||||||
mem_d(name);
|
mem_d(name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
/* reassign name */
|
|
||||||
mem_d(name);
|
|
||||||
name = util_strchp(name, strchr(name, ','));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now add the following items to the code system:
|
* Now add the following items to the code system:
|
||||||
* function
|
* function
|
||||||
|
|
10
util.c
10
util.c
|
@ -127,13 +127,11 @@ char *util_strchp(const char *s, const char *e) {
|
||||||
if (!s || !e)
|
if (!s || !e)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
size_t m = 0;
|
const char *c = s;
|
||||||
char *c = util_strdup(s);
|
while (c != e)
|
||||||
while (s != e)
|
c++;
|
||||||
s++,c++,m++;
|
|
||||||
|
|
||||||
*c = '\0';
|
return util_strdup(s);
|
||||||
return c-m;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue