mirror of
https://git.busybox.net/busybox
synced 2026-01-31 16:43:21 +00:00
I forgot to malloc space for the NULL.
-Erik
This commit is contained in:
parent
40e5e7c7ea
commit
ce4a586edb
3 changed files with 3 additions and 3 deletions
2
lash.c
2
lash.c
|
|
@ -936,7 +936,7 @@ char * strsep_space( char *string, int * index)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
token = xmalloc(*index);
|
||||
token = xmalloc(*index+1);
|
||||
token[*index] = '\0';
|
||||
strncpy(token, string, *index);
|
||||
|
||||
|
|
|
|||
2
sh.c
2
sh.c
|
|
@ -936,7 +936,7 @@ char * strsep_space( char *string, int * index)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
token = xmalloc(*index);
|
||||
token = xmalloc(*index+1);
|
||||
token[*index] = '\0';
|
||||
strncpy(token, string, *index);
|
||||
|
||||
|
|
|
|||
|
|
@ -936,7 +936,7 @@ char * strsep_space( char *string, int * index)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
token = xmalloc(*index);
|
||||
token = xmalloc(*index+1);
|
||||
token[*index] = '\0';
|
||||
strncpy(token, string, *index);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue