mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 14:12:36 +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);
|
||||
return false;
|
||||
}
|
||||
/* reassign name */
|
||||
mem_d(name);
|
||||
name = util_strchp(name, strchr(name, ','));
|
||||
|
||||
/*
|
||||
* Now add the following items to the code system:
|
||||
* function
|
||||
|
|
10
util.c
10
util.c
|
@ -127,13 +127,11 @@ char *util_strchp(const char *s, const char *e) {
|
|||
if (!s || !e)
|
||||
return NULL;
|
||||
|
||||
size_t m = 0;
|
||||
char *c = util_strdup(s);
|
||||
while (s != e)
|
||||
s++,c++,m++;
|
||||
const char *c = s;
|
||||
while (c != e)
|
||||
c++;
|
||||
|
||||
*c = '\0';
|
||||
return c-m;
|
||||
return util_strdup(s);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue