Copy the string terminator.
authorMatt Kraai <kraai@debian.org>
Thu, 14 Sep 2000 00:26:50 +0000 (00:26 -0000)
committerMatt Kraai <kraai@debian.org>
Thu, 14 Sep 2000 00:26:50 +0000 (00:26 -0000)
lash.c
sh.c
shell/lash.c

diff --git a/lash.c b/lash.c
index cd27e468bd7dc5b99633b02251c998088dd27369..b4b11fb8923d355fda9b6bbcb330547f7c5e7f65 100644 (file)
--- a/lash.c
+++ b/lash.c
@@ -1071,7 +1071,7 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi
 
                                        /* Now paste into the *commandPtr all the stuff 
                                         * leftover after the second backtick */
-                                       memcpy(src, charptr2, strlen(charptr2));
+                                       memcpy(src, charptr2, strlen(charptr2)+1);
                                        free(charptr2);
 
                                        /* Now recursively call parseCommand to deal with the new
diff --git a/sh.c b/sh.c
index cd27e468bd7dc5b99633b02251c998088dd27369..b4b11fb8923d355fda9b6bbcb330547f7c5e7f65 100644 (file)
--- a/sh.c
+++ b/sh.c
@@ -1071,7 +1071,7 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi
 
                                        /* Now paste into the *commandPtr all the stuff 
                                         * leftover after the second backtick */
-                                       memcpy(src, charptr2, strlen(charptr2));
+                                       memcpy(src, charptr2, strlen(charptr2)+1);
                                        free(charptr2);
 
                                        /* Now recursively call parseCommand to deal with the new
index cd27e468bd7dc5b99633b02251c998088dd27369..b4b11fb8923d355fda9b6bbcb330547f7c5e7f65 100644 (file)
@@ -1071,7 +1071,7 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi
 
                                        /* Now paste into the *commandPtr all the stuff 
                                         * leftover after the second backtick */
-                                       memcpy(src, charptr2, strlen(charptr2));
+                                       memcpy(src, charptr2, strlen(charptr2)+1);
                                        free(charptr2);
 
                                        /* Now recursively call parseCommand to deal with the new