ifupdown: stop emitting annoying/misleading error messages.
[oweals/busybox.git] / networking / httpd.c
index 8f985774e86dac21de9bc1ec02c48e05948fc33d..bbb2dfe7f29ecd15f5e61df964e788da9163e2bb 100644 (file)
@@ -97,14 +97,6 @@ static const char default_path_httpd_conf[] = "/etc";
 static const char httpd_conf[] = "httpd.conf";
 static const char home[] = "./";
 
-#if ENABLE_LFS
-# define cont_l_fmt "%lld"
-# define cont_l_type (long long)
-#else
-# define cont_l_fmt "%ld"
-# define cont_l_type (long)
-#endif
-
 #define TIMEOUT 60
 
 // Note: busybox xfuncs are not used because we want the server to keep running
@@ -927,8 +919,8 @@ static int sendHeaders(HttpResponseNum responseNum)
 
        if (config->ContentLength != -1) {    /* file */
                strftime(timeStr, sizeof(timeStr), RFC1123FMT, gmtime(&config->last_mod));
-               len += sprintf(buf+len, "Last-Modified: %s\r\n%s " cont_l_fmt "\r\n",
-                                                     timeStr, Content_length, cont_l_type config->ContentLength);
+               len += sprintf(buf+len, "Last-Modified: %s\r\n%s "OFF_FMT"\r\n",
+                               timeStr, Content_length, (off_t) config->ContentLength);
        }
        strcat(buf, "\r\n");
        len += 2;
@@ -1959,7 +1951,7 @@ int httpd_main(int argc, char *argv[])
 #endif
 #if ENABLE_FEATURE_HTTPD_WITHOUT_INETD
        if (opt & OPT_PORT)
-               config->port = bb_xgetlarg(s_port, 10, 1, 0xffff);
+               config->port = xatou16(s_port);
 #if ENABLE_FEATURE_HTTPD_SETUID
        if (opt & OPT_SETUID) {
                char *e;