summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--librt/spawn.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/librt/spawn.c b/librt/spawn.c
index 79f5b06a7..25e3994e1 100644
--- a/librt/spawn.c
+++ b/librt/spawn.c
@@ -203,9 +203,10 @@ __spawni(pid_t *pid, const char *file,
*--name = '/';
}
- char *p;
+ char *p = (char *)path;
do {
char *startp;
+ path = p;
p = strchrnul(path, ':');
/* Two adjacent colons, or a colon at the beginning or the end
@@ -233,7 +234,6 @@ __spawni(pid_t *pid, const char *file,
goto error;
}
- path = p;
} while (*p++ != '\0');
error: