summaryrefslogtreecommitdiff
path: root/libbb/getopt32.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/getopt32.c')
-rw-r--r--libbb/getopt32.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libbb/getopt32.c b/libbb/getopt32.c
index cd89032..913a009 100644
--- a/libbb/getopt32.c
+++ b/libbb/getopt32.c
@@ -497,8 +497,9 @@ getopt32(char **argv, const char *applet_opts, ...)
if (argv[1] && argv[1][0] != '-' && argv[1][1] != '\0') {
#if DONT_USE_PRINTF
char *pp = alloca(strlen(argv[1]) + 2);
- *pp++ = '-';
- argv[1] = strcpy(pp, argv[1]);
+ *pp = '-';
+ strcpy(pp + 1, argv[1]);
+ argv[1] = pp;
#else
argv[1] = xasprintf("-%s", argv[1]);
if (ENABLE_FEATURE_CLEAN_UP)