Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/rpcinfo simplify



details:   https://anonhg.NetBSD.org/src/rev/0ab7c93df358
branches:  trunk
changeset: 761869:0ab7c93df358
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Feb 10 00:05:52 2011 +0000

description:
simplify

diffstat:

 usr.bin/rpcinfo/rpcinfo.c |  12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diffs (29 lines):

diff -r 6cfee67848c9 -r 0ab7c93df358 usr.bin/rpcinfo/rpcinfo.c
--- a/usr.bin/rpcinfo/rpcinfo.c Wed Feb 09 22:01:44 2011 +0000
+++ b/usr.bin/rpcinfo/rpcinfo.c Thu Feb 10 00:05:52 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpcinfo.c,v 1.31 2011/02/09 06:26:48 dholland Exp $    */
+/*     $NetBSD: rpcinfo.c,v 1.32 2011/02/10 00:05:52 christos Exp $    */
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -1530,15 +1530,13 @@
 getvers(const char *arg)
 {
        char *strptr;
-       rpcvers_t vers;
-       unsigned long ulvers;
+       u_long vers;
 
-       ulvers = strtoul(arg, &strptr, 0);
+       vers = strtoul(arg, &strptr, 0);
        if (strptr == arg || *strptr != '\0' ||
-           (ulvers == ULONG_MAX && errno == ERANGE))
+           (vers == ULONG_MAX && errno == ERANGE))
                errx(1, "Illegal version number `%s'", arg);
-       vers = (rpcvers_t)ulvers;
-       return vers;
+       return (rpcvers_t)vers;
 }
 
 /*



Home | Main Index | Thread Index | Old Index