From 69bd506bf33fc4041836bacb0aa37393e7c78573 Mon Sep 17 00:00:00 2001 From: andersen Date: Wed, 14 Mar 2001 18:57:54 +0000 Subject: I forgot to malloc space for the NULL. -Erik git-svn-id: svn://busybox.net/trunk/busybox@2078 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- lash.c | 2 +- sh.c | 2 +- shell/lash.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lash.c b/lash.c index 8edb78369..1977d5fdc 100644 --- a/lash.c +++ b/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); diff --git a/sh.c b/sh.c index 8edb78369..1977d5fdc 100644 --- a/sh.c +++ b/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); diff --git a/shell/lash.c b/shell/lash.c index 8edb78369..1977d5fdc 100644 --- a/shell/lash.c +++ b/shell/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); -- cgit v1.2.3-55-g6feb