Fluff - no need to pause 1.3.21 or 22 release (though let me know if I
should press commit)..

Latest tarball (while trying to reproduce Ken's warnings); I found
that on some platforms (size_t) and that what sizeof() returns is
a long; and not an int.

Which gives a warning for the strings we print which have a %d. Not sure
if below is the right fix - or just a step downhill (and define a %z which
maps or something to size_t).

DW


Index: src/support/htpasswd.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/support/htpasswd.c,v
retrieving revision 1.43
diff -u -r1.43 htpasswd.c
--- src/support/htpasswd.c      2001/07/25 15:08:04     1.43
+++ src/support/htpasswd.c      2001/10/05 17:53:52
@@ -194,7 +194,7 @@
 #else
        if (ap_getpass("New password: ", pwin, sizeof(pwin)) != 0) {
            ap_snprintf(record, (rlen - 1), "password too long (>%d)",
-                       sizeof(pwin) - 1);
+                       (int)(sizeof(pwin) - 1));
            return ERR_OVERFLOW;
        }
        ap_getpass("Re-type new password: ", pwv, sizeof(pwv));
@@ -457,7 +457,7 @@
        strcpy(pwfilename, argv[i]);
        if (strlen(argv[i + 1]) > (sizeof(user) - 1)) {
            fprintf(stderr, "%s: username too long (>%d)\n", argv[0],
-                   sizeof(user) - 1);
+                   (int)(sizeof(user) - 1));
            return ERR_OVERFLOW;
        }
     }
@@ -470,7 +470,7 @@
     if (noninteractive) {
        if (strlen(argv[i + 2]) > (sizeof(password) - 1)) {
            fprintf(stderr, "%s: password too long (>%d)\n", argv[0],
-                   sizeof(password) - 1);
+                   (int)(sizeof(password) - 1));
            return ERR_OVERFLOW;
        }
        strcpy(password, argv[i + 2]);
Index: src/main/util_script.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/util_script.c,v
retrieving revision 1.158
diff -u -r1.158 util_script.c
--- src/main/util_script.c      2001/05/09 05:17:11     1.158
+++ src/main/util_script.c      2001/10/05 17:53:51
@@ -721,13 +721,13 @@
        ap_rputs("   1k", r);
     }
     else if (size < 1048576) {
-       ap_rprintf(r, "%4dk", (size + 512) / 1024);
+       ap_rprintf(r, "%4dk", (int)((size + 512) / 1024));
     }
     else if (size < 103809024) {
        ap_rprintf(r, "%4.1fM", size / 1048576.0);
     }
     else {
-       ap_rprintf(r, "%4dM", (size + 524288) / 1048576);
+       ap_rprintf(r, "%4dM", (int)((size + 524288) / 1048576));
     }
 }



Reply via email to