summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_install/add/perform.c
diff options
context:
space:
mode:
authorAnil Madhavapeddy <avsm@cvs.openbsd.org>2003-04-04 08:56:02 +0000
committerAnil Madhavapeddy <avsm@cvs.openbsd.org>2003-04-04 08:56:02 +0000
commitdf767a3328525b26a79f2a28f9984a9259766282 (patch)
tree1c7d7fd6c5f59e11b46e5779f919d0654e080ee8 /usr.sbin/pkg_install/add/perform.c
parent8f22089b34ec737d4331b517d8cf690df9544655 (diff)
some more strcpy/strcat -> strlcpy/strlcat conversions
ok and tweaks by ho@
Diffstat (limited to 'usr.sbin/pkg_install/add/perform.c')
-rw-r--r--usr.sbin/pkg_install/add/perform.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c
index 93ee1c96280..b46e269cd8f 100644
--- a/usr.sbin/pkg_install/add/perform.c
+++ b/usr.sbin/pkg_install/add/perform.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: perform.c,v 1.23 2003/04/03 19:42:53 avsm Exp $ */
+/* $OpenBSD: perform.c,v 1.24 2003/04/04 08:56:01 avsm Exp $ */
#ifndef lint
-static const char *rcsid = "$OpenBSD: perform.c,v 1.23 2003/04/03 19:42:53 avsm Exp $";
+static const char *rcsid = "$OpenBSD: perform.c,v 1.24 2003/04/04 08:56:01 avsm Exp $";
#endif
/*
@@ -61,9 +61,9 @@ static char *Home;
/* called to see if pkg is already installed as some other version */
/* note found version in "note" */
static int
-check_if_installed(const char *found, char *note)
+check_if_installed(const char *found, char *note, int len)
{
- strcpy(note, found);
+ strlcpy(note, found, len);
return 0;
}
@@ -256,7 +256,7 @@ pkg_do(char *pkg)
}
strlcpy(buf+(s-PkgName+1), isdigit(s[1]) ? "[0-9]*" : "*", sizeof(buf)-(s-PkgName+1));
- if (findmatchingname(dbdir, buf, check_if_installed, installed)) {
+ if (findmatchingname(dbdir, buf, check_if_installed, installed, sizeof(installed))) {
pwarnx("other version '%s' already installed", installed);
if (find_plist_option(&Plist, "no-default-conflict") != NULL) {
pwarnx("proceeding with installation anyway");
@@ -279,7 +279,7 @@ pkg_do(char *pkg)
/* was: */
/* if (!vsystem("/usr/sbin/pkg_info -qe '%s'", p->name)) {*/
- if(findmatchingname(dbdir, p->name, check_if_installed, installed)){
+ if(findmatchingname(dbdir, p->name, check_if_installed, installed, sizeof(installed))){
pwarnx("Conflicting package installed, please use\n\t\"pkg_delete %s\" first to remove it!\n", installed);
++code;
}
@@ -294,7 +294,7 @@ pkg_do(char *pkg)
if (Verbose)
printf("Package `%s' depends on `%s'\n", PkgName, p->name);
/* if (vsystem("/usr/sbin/pkg_info -qe '%s'", p->name)) { */
- if (!findmatchingname(dbdir, p->name, check_if_installed, installed)) {
+ if (!findmatchingname(dbdir, p->name, check_if_installed, installed, sizeof(installed))) {
char path[FILENAME_MAX], *cp = NULL;
if (!Fake) {