summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-02-16 01:53:29 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-02-16 01:53:29 +0000
commit30e7cbaff79c81f10d155653a4275e76f5105b10 (patch)
tree04d915a1b89b189910e48290ec64ba499ad63c92
parentf256e10a4d3e75af9c2fd0b67f7a87fdb49f79ef (diff)
strlcpy
-rw-r--r--usr.sbin/rpc.pcnfsd/pcnfsd_misc.c19
-rw-r--r--usr.sbin/rpc.pcnfsd/pcnfsd_print.c5
2 files changed, 13 insertions, 11 deletions
diff --git a/usr.sbin/rpc.pcnfsd/pcnfsd_misc.c b/usr.sbin/rpc.pcnfsd/pcnfsd_misc.c
index 1a42513589c..810837eef47 100644
--- a/usr.sbin/rpc.pcnfsd/pcnfsd_misc.c
+++ b/usr.sbin/rpc.pcnfsd/pcnfsd_misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcnfsd_misc.c,v 1.7 2003/02/15 12:15:04 deraadt Exp $ */
+/* $OpenBSD: pcnfsd_misc.c,v 1.8 2003/02/16 01:53:28 deraadt Exp $ */
/* $NetBSD: pcnfsd_misc.c,v 1.2 1995/07/25 22:20:42 gwr Exp $ */
/*
@@ -108,28 +108,29 @@ mapfont(f, i, b)
switch (f) {
case 'c':
- (void)strcpy(fontname, "Courier");
+ (void)strlcpy(fontname, "Courier", sizeof fontname);
break;
case 'h':
- (void)strcpy(fontname, "Helvetica");
+ (void)strlcpy(fontname, "Helvetica", sizeof fontname);
break;
case 't':
- (void)strcpy(fontname, "Times");
+ (void)strlcpy(fontname, "Times", sizeof fontname);
break;
default:
- (void)strcpy(fontname, "Times-Roman");
+ (void)strlcpy(fontname, "Times-Roman", sizeof fontname);
goto finis ;
}
if (i != 'o' && b != 'b') { /* no bold or oblique */
if (f == 't') /* special case Times */
- (void)strcat(fontname, "-Roman");
+ (void)strlcat(fontname, "-Roman", sizeof fontname);
goto finis;
}
- (void)strcat(fontname, "-");
+ (void)strlcat(fontname, "-", sizeof fontname);
if (b == 'b')
- (void)strcat(fontname, "Bold");
+ (void)strlcat(fontname, "Bold", sizeof fontname);
if (i == 'o') /* o-blique */
- (void)strcat(fontname, f == 't' ? "Italic" : "Oblique");
+ (void)strlcat(fontname, f == 't' ? "Italic" : "Oblique",
+ sizeof fontname);
finis:
return (&fontname[0]);
diff --git a/usr.sbin/rpc.pcnfsd/pcnfsd_print.c b/usr.sbin/rpc.pcnfsd/pcnfsd_print.c
index c7acbaa9158..bbf1267c327 100644
--- a/usr.sbin/rpc.pcnfsd/pcnfsd_print.c
+++ b/usr.sbin/rpc.pcnfsd/pcnfsd_print.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcnfsd_print.c,v 1.14 2003/02/15 12:15:04 deraadt Exp $ */
+/* $OpenBSD: pcnfsd_print.c,v 1.15 2003/02/16 01:53:28 deraadt Exp $ */
/* $NetBSD: pcnfsd_print.c,v 1.3 1995/08/14 19:45:18 gwr Exp $ */
/*
@@ -276,7 +276,8 @@ pr_start2(system, pr, user, fname, opts, id)
resbuf[i-1] = '\0'; /* trim NL */
if (!strncmp(resbuf, "request id is ", 14))
/* New - just the first word is needed */
- strcpy(req_id, strtok(&resbuf[14], delims));
+ strlcpy(req_id, strtok(&resbuf[14], delims),
+ sizeof req_id);
else if (strembedded("disabled", resbuf))
failed = 1;
}