diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-04-14 00:40:59 +0200 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-04-20 19:14:43 +0200 |
commit | 64ab89438d39b9ffa30f6b5fb1867b0fb11f28f1 (patch) | |
tree | a6df6941a6f33d6c681bcb7857a9189b51cc17d7 /shell | |
parent | 0d7c618c2f29543beed3f9c9b8138d6de9b478ff (diff) | |
download | busybox-w32-64ab89438d39b9ffa30f6b5fb1867b0fb11f28f1.tar.gz busybox-w32-64ab89438d39b9ffa30f6b5fb1867b0fb11f28f1.tar.bz2 busybox-w32-64ab89438d39b9ffa30f6b5fb1867b0fb11f28f1.zip |
win32: ash: nodeckstrdup(): tolerate NULL string
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c index 0ee72dcd3..137d8edde 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -8144,10 +8144,12 @@ calcsize(union node *n) | |||
8144 | } | 8144 | } |
8145 | 8145 | ||
8146 | static char * | 8146 | static char * |
8147 | nodeckstrdup(char *s) | 8147 | nodeckstrdup(const char *s) |
8148 | { | 8148 | { |
8149 | char *rtn = funcstring; | 8149 | char *rtn = funcstring; |
8150 | 8150 | ||
8151 | if (!s) | ||
8152 | return NULL; | ||
8151 | strcpy(funcstring, s); | 8153 | strcpy(funcstring, s); |
8152 | funcstring += strlen(s) + 1; | 8154 | funcstring += strlen(s) + 1; |
8153 | return rtn; | 8155 | return rtn; |