diff options
author | Glenn L McGrath | 2003-08-29 15:53:23 +0000 |
---|---|---|
committer | Glenn L McGrath | 2003-08-29 15:53:23 +0000 |
commit | 5cd6461b6fb51e8cf297a49074fce825e1960774 (patch) | |
tree | ae4e99ee1f605df5cc2215f7c4a2a0709f6325b2 /networking | |
parent | e01c550eab1c4d7299ea9b1ab4801c2e16ab0a03 (diff) | |
download | busybox-5cd6461b6fb51e8cf297a49074fce825e1960774.zip busybox-5cd6461b6fb51e8cf297a49074fce825e1960774.tar.gz |
"Due to a wrong format parameter in a printf httpd does not work when
compiled for with CONFIG_LFS (large file support).
The attached patch suggested by Vladimir fixes that." - Steven Scholz
Diffstat (limited to 'networking')
-rw-r--r-- | networking/httpd.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index d58414b..8c87e7e 100644 --- a/networking/httpd.c +++ b/networking/httpd.c @@ -127,6 +127,13 @@ static const char default_path_httpd_conf[] = "/etc"; static const char httpd_conf[] = "httpd.conf"; static const char home[] = "./"; +#ifdef CONFIG_LFS +# define cont_l_fmt "%lld" +#else +# define cont_l_fmt "%ld" +#endif + + // Note: bussybox xfuncs are not used because we want the server to keep running // if something bad happens due to a malformed user request. // As a result, all memory allocation after daemonize @@ -932,7 +939,7 @@ static int sendHeaders(HttpResponseNum responseNum) #endif if (config->ContentLength != -1) { /* file */ strftime(timeStr, sizeof(timeStr), RFC1123FMT, gmtime(&config->last_mod)); - len += sprintf(buf+len, "Last-Modified: %s\r\n%s %ld\r\n", + len += sprintf(buf+len, "Last-Modified: %s\r\n%s " cont_l_fmt "\r\n", timeStr, Content_length, config->ContentLength); } strcat(buf, "\r\n"); |