diff options
author | Ron Yorston <rmy@pobox.com> | 2020-08-13 11:43:26 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2020-08-13 14:58:01 +0100 |
commit | 7d639339e0c46311f8873d560e6f168e71473cd9 (patch) | |
tree | e483966b030472f5c0ae85c0a11f090acbaa57ff /networking | |
parent | 258ad6a1d52f1811f9de1d6b976f3797f5b31a2b (diff) | |
download | busybox-w32-7d639339e0c46311f8873d560e6f168e71473cd9.tar.gz busybox-w32-7d639339e0c46311f8873d560e6f168e71473cd9.tar.bz2 busybox-w32-7d639339e0c46311f8873d560e6f168e71473cd9.zip |
win32: use a static buffer in get_system_drive()
Allocate static storage for the system drive string instead of
making a new allocation on every call. This is easier to manage.
Adds 16 bytes.
Diffstat (limited to 'networking')
-rw-r--r-- | networking/httpd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index 5105eedac..cfb635df3 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -665,7 +665,7 @@ static void parse_conf(const char *path, int flag) | |||
665 | filename = alloca(strlen(path) + sizeof(HTTPD_CONF) + 2); | 665 | filename = alloca(strlen(path) + sizeof(HTTPD_CONF) + 2); |
666 | sprintf((char *)filename, "%s/%s", path, HTTPD_CONF); | 666 | sprintf((char *)filename, "%s/%s", path, HTTPD_CONF); |
667 | #else | 667 | #else |
668 | char *sd = get_system_drive(); | 668 | const char *sd = get_system_drive(); |
669 | 669 | ||
670 | filename = auto_string(xasprintf("%s%s/%s", | 670 | filename = auto_string(xasprintf("%s%s/%s", |
671 | (sd && path[0] == '/' && root_len(path) == 0) ? sd : "", | 671 | (sd && path[0] == '/' && root_len(path) == 0) ? sd : "", |