summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_install/sign
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-04-25 09:08:19 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-04-25 09:08:19 +0000
commit657037c116e3b909989c0e8a8a20d088b4d169d7 (patch)
tree376798985022e5c2857816b3416d09d142acffc2 /usr.sbin/pkg_install/sign
parent959aec0334df62dfda23b737b0e22badf95683a8 (diff)
eliminate a sprintf in code we don't use, prodded by and ok jsyn@
Diffstat (limited to 'usr.sbin/pkg_install/sign')
-rw-r--r--usr.sbin/pkg_install/sign/sign.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.sbin/pkg_install/sign/sign.c b/usr.sbin/pkg_install/sign/sign.c
index ea1cf554971..48fed01aecd 100644
--- a/usr.sbin/pkg_install/sign/sign.c
+++ b/usr.sbin/pkg_install/sign/sign.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sign.c,v 1.3 1999/10/04 21:46:29 espie Exp $ */
+/* $OpenBSD: sign.c,v 1.4 2003/04/25 09:08:18 henning Exp $ */
/*-
* Copyright (c) 1999 Marc Espie.
*
@@ -114,13 +114,11 @@ sign(filename, type, userid, envp)
free_signature(sign);
return 0;
}
- copy = malloc(strlen(filename)+sizeof(COPY_TEMPLATE));
- if (copy == NULL) {
+ if (asprintf(&copy, COPY_TEMPLATE, filename) == -1) {
fprintf(stderr, "Can't allocate memory\n");
free_signature(sign);
return 0;
}
- sprintf(copy, COPY_TEMPLATE, filename);
result = embed_signature(filename, copy, sign);
if (result == 0) {
fprintf(stderr, "Can't embed signature in %s\n", filename);