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/info Allocate space & copy a string ret...



details:   https://anonhg.NetBSD.org/src/rev/a0b4b4df014e
branches:  trunk
changeset: 488127:a0b4b4df014e
user:      hubertf <hubertf%NetBSD.org@localhost>
date:      Mon Jun 19 00:55:11 2000 +0000

description:
Allocate space & copy a string returned by a function that'll clobber it on
next call.

diffstat:

 usr.sbin/pkg_install/info/main.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (26 lines):

diff -r f96d94c3a237 -r a0b4b4df014e usr.sbin/pkg_install/info/main.c
--- a/usr.sbin/pkg_install/info/main.c  Sun Jun 18 23:57:32 2000 +0000
+++ b/usr.sbin/pkg_install/info/main.c  Mon Jun 19 00:55:11 2000 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: main.c,v 1.22 2000/06/07 03:17:10 hubertf Exp $        */
+/*     $NetBSD: main.c,v 1.23 2000/06/19 00:55:11 hubertf Exp $        */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char *rcsid = "from FreeBSD Id: main.c,v 1.14 1997/10/08 07:47:26 charnier Exp";
 #else
-__RCSID("$NetBSD: main.c,v 1.22 2000/06/07 03:17:10 hubertf Exp $");
+__RCSID("$NetBSD: main.c,v 1.23 2000/06/19 00:55:11 hubertf Exp $");
 #endif
 #endif
 
@@ -206,7 +206,7 @@
                s = pkgdb_retrieve(CheckPkg);
 
                if (s) {
-                       CheckPkg = s;
+                       CheckPkg = strdup(s);
                } else {
                        errx(1, "No matching pkg for %s.", CheckPkg);
                }



Home | Main Index | Thread Index | Old Index