Module Name: src
Committed By: christos
Date: Thu Jun 20 15:58:59 UTC 2019
Modified Files:
src/usr.sbin/sysinst: configmenu.c
Log Message:
use proper format strings in replace().
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sysinst/configmenu.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/sysinst/configmenu.c
diff -u src/usr.sbin/sysinst/configmenu.c:1.7 src/usr.sbin/sysinst/configmenu.c:1.8
--- src/usr.sbin/sysinst/configmenu.c:1.7 Wed Jun 19 20:43:55 2019
+++ src/usr.sbin/sysinst/configmenu.c Thu Jun 20 11:58:59 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: configmenu.c,v 1.7 2019/06/20 00:43:55 christos Exp $ */
+/* $NetBSD: configmenu.c,v 1.8 2019/06/20 15:58:59 christos Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -295,7 +295,6 @@ set_binpkg(struct menudesc *menu, void *
{
configinfo **confp = arg;
char additional_pkgs[STRSIZE] = {0};
- char pattern[STRSIZE];
int allok = 0;
arg_rv parm;
@@ -316,8 +315,8 @@ set_binpkg(struct menudesc *menu, void *
} while (allok == 0);
/* configure pkgin to use $pkgpath as a repository */
- snprintf(pattern, STRSIZE, "s,^[^#].*$,%s,", pkgpath);
- replace("/usr/pkg/etc/pkgin/repositories.conf", pattern);
+ replace("/usr/pkg/etc/pkgin/repositories.conf", "s,^[^#].*$,%s,",
+ pkgpath);
run_program(RUN_DISPLAY | RUN_PROGRESS | RUN_CHROOT,
"/usr/pkg/bin/pkgin -y update");
@@ -425,7 +424,7 @@ toggle_rcvar(struct menudesc *menu, void
fprintf(logfp, "replacement pattern is %s\n", pattern);
fflush(logfp);
}
- replace("/etc/rc.conf", pattern);
+ replace("/etc/rc.conf", "%s", pattern);
}
return 0;