diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-03-30 20:57:28 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-03-30 20:57:28 +0000 |
commit | 65bffc3119e235ee616b2d7954d9c178cf425301 (patch) | |
tree | 0f43a1c7a61613c973b87f1fd9ccf59e1a9f83bc /usr.bin/rpcgen | |
parent | b03cd4b8961d6d01dd208bed592a72ca27b43549 (diff) |
snprintf; millert ok
Diffstat (limited to 'usr.bin/rpcgen')
-rw-r--r-- | usr.bin/rpcgen/rpc_scan.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/rpcgen/rpc_scan.c b/usr.bin/rpcgen/rpc_scan.c index 9c75b6d10ba..5fa50842af1 100644 --- a/usr.bin/rpcgen/rpc_scan.c +++ b/usr.bin/rpcgen/rpc_scan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rpc_scan.c,v 1.10 2002/07/05 05:39:42 deraadt Exp $ */ +/* $OpenBSD: rpc_scan.c,v 1.11 2003/03/30 20:57:27 deraadt Exp $ */ /* $NetBSD: rpc_scan.c,v 1.4 1995/06/11 21:50:02 pk Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -288,16 +288,16 @@ get_token(tokp) default: if (!(isalpha(*where) || *where == '_')) { - char buf[100]; - char *p; + char buf[100], chs[20]; - snprintf(buf, sizeof buf, "illegal character in file: "); - p = buf + strlen(buf); if (isprint(*where)) { - sprintf(p, "%c", *where); + snprintf(chs, sizeof chs, "%c", *where); } else { - sprintf(p, "%d", *where); + snprintf(chs, sizeof chs, "%d", *where); } + + snprintf(buf, sizeof buf, + "illegal character in file: %s", chs); error(buf); } findkind(&where, tokp); |