diff options
author | Ron Yorston <rmy@pobox.com> | 2021-02-13 10:17:16 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2021-02-13 10:17:16 +0000 |
commit | 8489ebce32f4b6cf5c1c1120fd474e26f7659db7 (patch) | |
tree | eaa5471ae7c13aaf335358fdf1079547fea0226a /win32 | |
parent | 7587b56c10a4d11fe434e3eaa51212113f09ec10 (diff) | |
download | busybox-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 'win32')
-rw-r--r-- | win32/mingw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index a6362333d..75635fdf1 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -1729,7 +1729,7 @@ char *alloc_system_drive(const char *path) | |||
1729 | { | 1729 | { |
1730 | const char *sd = need_system_drive(path); | 1730 | const char *sd = need_system_drive(path); |
1731 | char *s = xmalloc(strlen(path) + 5 + (sd ? strlen(sd) : 0)); | 1731 | char *s = xmalloc(strlen(path) + 5 + (sd ? strlen(sd) : 0)); |
1732 | sprintf(s, "%s%s", sd ?: "", path); | 1732 | strcpy(stpcpy(s, sd ?: ""), path); |
1733 | return s; | 1733 | return s; |
1734 | } | 1734 | } |
1735 | 1735 | ||