Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/pkg_install/lib -current's gcc seems to be a bit pi...



details:   https://anonhg.NetBSD.org/src/rev/a24e3c898ab6
branches:  trunk
changeset: 481290:a24e3c898ab6
user:      hubertf <hubertf%NetBSD.org@localhost>
date:      Tue Jan 25 17:21:07 2000 +0000

description:
-current's gcc seems to be a bit picky about using pointer-differences as
args to the "*" of a printf "%*.*s" pattern. Add some casts to int.
(At least on NetBSD, ptrdiff_t is typedef'ed to int anyways)

diffstat:

 usr.sbin/pkg_install/lib/ftpio.c |  17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diffs (52 lines):

diff -r fb5b3abbacc8 -r a24e3c898ab6 usr.sbin/pkg_install/lib/ftpio.c
--- a/usr.sbin/pkg_install/lib/ftpio.c  Tue Jan 25 17:20:47 2000 +0000
+++ b/usr.sbin/pkg_install/lib/ftpio.c  Tue Jan 25 17:21:07 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftpio.c,v 1.7 2000/01/19 23:28:33 hubertf Exp $        */
+/*     $NetBSD: ftpio.c,v 1.8 2000/01/25 17:21:07 hubertf Exp $        */
 /*      Id: foo2.c,v 1.12 1999/12/17 02:31:57 feyrer Exp feyrer        */
 
 /*
@@ -404,7 +404,8 @@
        warnx("expandURL: no '/' in url %s?!", wildcardurl);
        return -1;
     }
-    snprintf(base, FILENAME_MAX, "%*.*s/", pkg-wildcardurl, pkg-wildcardurl, wildcardurl);
+    snprintf(base, FILENAME_MAX, "%*.*s/", (int)(pkg-wildcardurl),
+             (int)(pkg-wildcardurl), wildcardurl);
     pkg++;
 
     rc = ftp_start(base);
@@ -435,7 +436,8 @@
                 * we can't use the pkg wildcards here as dewey compare
                 * and alternates won't be handled by ftp(1); sort
                 * out later, using pmatch() */
-               snprintf(buf, FILENAME_MAX, "ls %*.*s*.tgz %s\n", s-pkg, s-pkg, pkg, tmpname);
+               snprintf(buf, FILENAME_MAX, "ls %*.*s*.tgz %s\n",
+                         (int)(s-pkg), (int)(s-pkg), pkg, tmpname);
        }
        
        rc = ftp_cmd(buf, "\n(550|226).*\n"); /* catch errors */
@@ -528,8 +530,10 @@
                warnx("unpackURL: no '/' in url %s?!", url);
                return -1;
        }
-       snprintf(base, FILENAME_MAX, "%*.*s/", pkg-url, pkg-url, url);
-       snprintf(pkg_path, FILENAME_MAX, "%*.*s", pkg-url, pkg-url, url); /* no trailing '/' */
+       snprintf(base, FILENAME_MAX, "%*.*s/", (int)(pkg-url),
+                 (int)(pkg-url), url);
+       snprintf(pkg_path, FILENAME_MAX, "%*.*s", (int)(pkg-url),
+                 (int)(pkg-url), url); /* no trailing '/' */
        pkg++;
 
        /* Leave a hint for any depending pkgs that may need it */
@@ -579,7 +583,8 @@
        warnx("miscstuff: no '/' in url %s?!", url);
        return -1;
     }
-    snprintf(base, FILENAME_MAX, "%*.*s/", pkg-url, pkg-url, url);
+    snprintf(base, FILENAME_MAX, "%*.*s/", (int)(pkg-url), (int)(pkg-url),
+             url);
     pkg++;
 
     rc = ftp_start(base);



Home | Main Index | Thread Index | Old Index