summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-06 18:49:19 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-06 18:49:19 +0000
commit997f28507be542389b846c45806474af6bbfdedc (patch)
treea316a0a0847353ea49cecafa91539e6acfbb62a5
parent9ad5a89d71e6258d23009dcb2b29d08560e511e3 (diff)
use strlcat
-rw-r--r--usr.bin/rpcgen/rpc_cout.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/rpcgen/rpc_cout.c b/usr.bin/rpcgen/rpc_cout.c
index be22d6a5982..fbc6ed2a94c 100644
--- a/usr.bin/rpcgen/rpc_cout.c
+++ b/usr.bin/rpcgen/rpc_cout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rpc_cout.c,v 1.14 2003/03/13 09:09:34 deraadt Exp $ */
+/* $OpenBSD: rpc_cout.c,v 1.15 2003/04/06 18:49:18 deraadt Exp $ */
/* $NetBSD: rpc_cout.c,v 1.6 1996/10/01 04:13:53 cgd Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -507,15 +507,18 @@ emit_struct(def)
crash();
}
} else {
- sizestr = (char *)realloc(sizestr,
- strlen(sizestr) + strlen(ptemp) + 1);
+ size_t len;
+
+ len = strlen(sizestr) +
+ strlen(ptemp) + 1;
+ sizestr = (char *)realloc(sizestr, len);
if (sizestr == NULL) {
fprintf(stderr,
"Fatal error : no memory\n");
crash();
}
/* build up length of array */
- sizestr = strcat(sizestr, ptemp);
+ strlcat(sizestr, ptemp, len);
}
}