diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-14 19:46:00 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-14 19:46:00 +0000 |
commit | 29724d3e0ab184cb27a4782fcd55c5dad3f551d7 (patch) | |
tree | d3a423a480208b18135ef2d4f07a983eb37630c1 /usr.bin | |
parent | e3b9387ca9f59798d3325cd9aa554d056f07a24a (diff) |
oops
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/rpcgen/rpc_main.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c index eb3c5543631..d67c40c767e 100644 --- a/usr.bin/rpcgen/rpc_main.c +++ b/usr.bin/rpcgen/rpc_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rpc_main.c,v 1.16 2003/04/14 04:51:28 deraadt Exp $ */ +/* $OpenBSD: rpc_main.c,v 1.17 2003/04/14 19:45:59 deraadt Exp $ */ /* $NetBSD: rpc_main.c,v 1.9 1996/02/19 11:12:43 pk Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -32,7 +32,7 @@ #ifndef lint static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI"; -static char cvsid[] = "$OpenBSD: rpc_main.c,v 1.16 2003/04/14 04:51:28 deraadt Exp $"; +static char cvsid[] = "$OpenBSD: rpc_main.c,v 1.17 2003/04/14 19:45:59 deraadt Exp $"; #endif /* @@ -224,15 +224,13 @@ extendfile(path, ext) char *file; char *res; char *p; - size_t len; if ((file = strrchr(path, '/')) == NULL) file = path; else file++; - len = strlen(file) + strlen(ext) + 1; - res = alloc(len); + res = alloc(strlen(file) + strlen(ext) + 1); if (res == NULL) { fprintf(stderr, "could not allocate memory\n"); exit(1); @@ -240,8 +238,8 @@ extendfile(path, ext) p = strrchr(file, '.'); if (p == NULL) p = file + strlen(file); - (void) strlcpy(res, file, len); - (void) strlcpy(res, ext, len - (p - file)); + (void) strcpy(res, file); + (void) strcpy(res + (p - file), ext); return (res); } |