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-09-14 11:04:22 +1000 |
commit | 40f78f44fe2fa52698be992ed3a8c0cf5429f8d6 (patch) | |
tree | c3beacff9bb30ed99be8bb203d4122be34cf8cb4 | |
parent | a7b648d26f7ace9c025e5f4ae5060d83d69080ce (diff) | |
download | busybox-w32-40f78f44fe2fa52698be992ed3a8c0cf5429f8d6.tar.gz busybox-w32-40f78f44fe2fa52698be992ed3a8c0cf5429f8d6.tar.bz2 busybox-w32-40f78f44fe2fa52698be992ed3a8c0cf5429f8d6.zip |
win32: ash: nodeckstrdup(): tolerate NULL string
-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 181357c1c..d4b60f081 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; |