=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rpcgen/rpc_main.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- src/usr.bin/rpcgen/rpc_main.c 2003/04/14 04:51:28 1.16 +++ src/usr.bin/rpcgen/rpc_main.c 2003/04/14 19:45:59 1.17 @@ -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 @@ 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 @@ 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); }