Fixed all invalid mmeory accesses

This commit is contained in:
Dale Weiler 2012-04-28 06:31:16 -04:00
parent b09d75518c
commit 1d6594a491
3 changed files with 6 additions and 12 deletions

4
asm.c
View file

@ -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
View file

@ -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;
} }
/* /*