Source-Changes-HG archive

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

[src/netbsd-1-6]: src/usr.sbin/pkg_install/admin Pull up revisions 1.25-1.26 ...



details:   https://anonhg.NetBSD.org/src/rev/465894b9d5a4
branches:  netbsd-1-6
changeset: 528262:465894b9d5a4
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Jun 28 12:43:15 2002 +0000

description:
Pull up revisions 1.25-1.26 (requested by taca in ticket #369):
- fix buffer size checks
- define PKG_PATTEN_MAX and PKG_SUFFIX_MAX and
  use them instead of constants like 255.
- add asserts and buffer size checks.
- constify and make WARNS=2 clean.
- Fixes provided by Stoned Elipot <seb%script.jussieu.fr@localhost> in PR 17323

diffstat:

 usr.sbin/pkg_install/admin/main.c |  15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diffs (55 lines):

diff -r f059031748fc -r 465894b9d5a4 usr.sbin/pkg_install/admin/main.c
--- a/usr.sbin/pkg_install/admin/main.c Fri Jun 28 12:43:06 2002 +0000
+++ b/usr.sbin/pkg_install/admin/main.c Fri Jun 28 12:43:15 2002 +0000
@@ -1,8 +1,8 @@
-/*     $NetBSD: main.c,v 1.24 2002/03/05 13:01:19 agc Exp $    */
+/*     $NetBSD: main.c,v 1.24.2.1 2002/06/28 12:43:15 lukem Exp $      */
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.24 2002/03/05 13:01:19 agc Exp $");
+__RCSID("$NetBSD: main.c,v 1.24.2.1 2002/06/28 12:43:15 lukem Exp $");
 #endif
 
 /*
@@ -52,6 +52,8 @@
 int     filecnt;
 int     pkgcnt;
 
+static int checkpattern_fn(const char *, void *);
+
 /*
  * Assumes CWD is in /var/db/pkg/<pkg>!
  */
@@ -307,7 +309,7 @@
 }
 
 static int
-checkpattern_fn(const char *pkg, char *data)
+checkpattern_fn(const char *pkg, void *vp)
 {
        int     rc;
 
@@ -324,8 +326,9 @@
 }
 
 static int
-lspattern_fn(const char *pkg, char *data)
+lspattern_fn(const char *pkg, void *vp)
 {
+       char *data = vp;
        printf("%s/%s\n", data, pkg);
        
        return 0;
@@ -471,8 +474,10 @@
 
                        cwd = getcwd(NULL, 0);
                        p = findbestmatchingname(cwd, base);
-                       if (p)
+                       if (p) {
                                printf("%s/%s\n", cwd, p);
+                               free(p);
+                       }
                        free(cwd);
                        
                        argv++;



Home | Main Index | Thread Index | Old Index