aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-03-14 18:57:54 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-03-14 18:57:54 +0000
commit69bd506bf33fc4041836bacb0aa37393e7c78573 (patch)
treeb9fa59609eca6700fe84d05ccbb87afeac08329e
parent893bf282f44b362a18024ccdc7298bba35a4f8cb (diff)
downloadbusybox-w32-69bd506bf33fc4041836bacb0aa37393e7c78573.tar.gz
busybox-w32-69bd506bf33fc4041836bacb0aa37393e7c78573.tar.bz2
busybox-w32-69bd506bf33fc4041836bacb0aa37393e7c78573.zip
I forgot to malloc space for the NULL.
-Erik git-svn-id: svn://busybox.net/trunk/busybox@2078 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--lash.c2
-rw-r--r--sh.c2
-rw-r--r--shell/lash.c2
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)
936 return NULL; 936 return NULL;
937 } 937 }
938 938
939 token = xmalloc(*index); 939 token = xmalloc(*index+1);
940 token[*index] = '\0'; 940 token[*index] = '\0';
941 strncpy(token, string, *index); 941 strncpy(token, string, *index);
942 942
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)
936 return NULL; 936 return NULL;
937 } 937 }
938 938
939 token = xmalloc(*index); 939 token = xmalloc(*index+1);
940 token[*index] = '\0'; 940 token[*index] = '\0';
941 strncpy(token, string, *index); 941 strncpy(token, string, *index);
942 942
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)
936 return NULL; 936 return NULL;
937 } 937 }
938 938
939 token = xmalloc(*index); 939 token = xmalloc(*index+1);
940 token[*index] = '\0'; 940 token[*index] = '\0';
941 strncpy(token, string, *index); 941 strncpy(token, string, *index);
942 942