From: Wichert Akkerman Date: Tue, 23 Nov 1999 20:48:25 +0000 (+0000) Subject: Add strdup to start-stop-daemon X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3b861c1ac307cfe324c7295710e13060e6d1c9d;p=dpkg Add strdup to start-stop-daemon --- diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index 3e739627..bf47531b 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -311,7 +311,10 @@ parse_options(int argc, char * const *argv) execname = optarg; break; case 'c': /* --chuid | */ - changeuser = strtok(optarg, ":"); + /* we copy the string just in case we need the + * argument later. */ + changeuser = strdup(optarg); + changeuser = strtok(changeuser, ":"); changegroup = strtok(NULL, ":"); break; case 'b': /* --background */