aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-02-13 10:17:16 +0000
committerRon Yorston <rmy@pobox.com>2021-02-13 10:17:16 +0000
commit8489ebce32f4b6cf5c1c1120fd474e26f7659db7 (patch)
treeeaa5471ae7c13aaf335358fdf1079547fea0226a /shell
parent7587b56c10a4d11fe434e3eaa51212113f09ec10 (diff)
downloadbusybox-w32-8489ebce32f4b6cf5c1c1120fd474e26f7659db7.tar.gz
busybox-w32-8489ebce32f4b6cf5c1c1120fd474e26f7659db7.tar.bz2
busybox-w32-8489ebce32f4b6cf5c1c1120fd474e26f7659db7.zip
win32: code shrink
Rewrite the recent change to tab completion so it only needs one call to sprintf. Then replace sprintf with strcpy/stpcpy, both there and in a couple of other places. Saves 40 bytes.
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index c400612d9..f8a18cdc5 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -2119,7 +2119,7 @@ stack_add_system_drive(const char *path)
2119 const char *sd = need_system_drive(path); 2119 const char *sd = need_system_drive(path);
2120 char *p = growstackto(strlen(path) + 5 + (sd ? strlen(sd) : 0)); 2120 char *p = growstackto(strlen(path) + 5 + (sd ? strlen(sd) : 0));
2121 2121
2122 sprintf(p, "%s%s", sd ?: "", path); 2122 strcpy(stpcpy(p, sd ?: ""), path);
2123 return p; 2123 return p;
2124} 2124}
2125#endif 2125#endif