motherfucking strncpy
This commit is contained in:
parent
727556295e
commit
24e2d04c68
1 changed files with 1 additions and 1 deletions
|
@ -60,10 +60,10 @@ char *remove_whitespaces(const char *str) {
|
|||
i += 1;
|
||||
j += 1;
|
||||
}
|
||||
tmp[j] = '\0';
|
||||
|
||||
char *ret = malloc(j * sizeof(char));
|
||||
strncpy(ret, tmp, j);
|
||||
ret[j] = '\0';
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue