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/info Pull up revisions 1.22-1.23 (...



details:   https://anonhg.NetBSD.org/src/rev/28973e46c70b
branches:  netbsd-1-6
changeset: 528271:28973e46c70b
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Jun 28 12:44:31 2002 +0000

description:
Pull up revisions 1.22-1.23 (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/info/show.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 25ce168e39f1 -r 28973e46c70b usr.sbin/pkg_install/info/show.c
--- a/usr.sbin/pkg_install/info/show.c  Fri Jun 28 12:44:23 2002 +0000
+++ b/usr.sbin/pkg_install/info/show.c  Fri Jun 28 12:44:31 2002 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: show.c,v 1.21 2002/03/05 14:18:07 agc Exp $    */
+/*     $NetBSD: show.c,v 1.21.2.1 2002/06/28 12:44:31 lukem Exp $      */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: show.c,v 1.11 1997/10/08 07:47:38 charnier Exp";
 #else
-__RCSID("$NetBSD: show.c,v 1.21 2002/03/05 14:18:07 agc Exp $");
+__RCSID("$NetBSD: show.c,v 1.21.2.1 2002/06/28 12:44:31 lukem Exp $");
 #endif
 #endif
 
@@ -74,7 +74,7 @@
  * The entries in this table must be ordered the same as
  * pl_ent_t constants
  */
-static show_t showv[] = {
+static const show_t showv[] = {
        {PLIST_FILE, "%s", "\tFile: %s"},
        {PLIST_CWD, "@cwd %s", "\tCWD to: %s"},
        {PLIST_CMD, "@exec %s", "\tEXEC '%s'"},
@@ -111,7 +111,7 @@
        if ((fp = fopen(fname, "r")) == (FILE *) NULL) {
                printf("ERROR: show_file: Can't open '%s' for reading!\n", fname);
        } else {
-               while ((n = fread(line, 1, 1024, fp)) != 0) {
+               while ((n = fread(line, 1, sizeof(line), fp)) != 0) {
                        fwrite(line, 1, n, stdout);
                }
                (void) fclose(fp);



Home | Main Index | Thread Index | Old Index