From cb1400e74370e87b12dae27a5b725a6db01daf0e Mon Sep 17 00:00:00 2001 From: axtloss Date: Tue, 27 Feb 2024 21:28:32 +0100 Subject: Add ellipse function --- fbwarn/src/warn.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'fbwarn/src/warn.c') diff --git a/fbwarn/src/warn.c b/fbwarn/src/warn.c index 8adda19..c2ef7d3 100644 --- a/fbwarn/src/warn.c +++ b/fbwarn/src/warn.c @@ -38,7 +38,7 @@ int getFuncs(char *file, char ***ret) { sprintf(funcline, "%s%s", funcline, line); if (line[nread-2] == ')' || line[nread-1] == ')') { funcCount += 1; - newFuncsMem = sizeof(char)*(sizeof(funcs)+sizeof(funcline)); + newFuncsMem = sizeof(char)*(sizeof(funcs)+sizeof(funcline)*funcCount); void *newfuncs = realloc(funcs, newFuncsMem); if (newfuncs) funcs = newfuncs; @@ -54,14 +54,7 @@ int getFuncs(char *file, char ***ret) { free(line); fclose(bvgfile); - //char **alloc = realloc(*ret, newFuncsMem); - //if (alloc) - *ret = funcs; - //else - // exit(2); - // free(alloc); - //memcpy(*ret, funcs, newFuncsMem); - //free(funcs); + *ret = funcs; return funcCount; } -- cgit v1.2.3