Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/inet remove unneeded code, and kill parens from return
details: https://anonhg.NetBSD.org/src/rev/3e9938b7912c
branches: trunk
changeset: 326661:3e9938b7912c
user: christos <christos%NetBSD.org@localhost>
date: Mon Feb 10 16:30:54 2014 +0000
description:
remove unneeded code, and kill parens from return
diffstat:
lib/libc/inet/inet_ntop.c | 20 +++++++++-----------
1 files changed, 9 insertions(+), 11 deletions(-)
diffs (59 lines):
diff -r d9c23882d15c -r 3e9938b7912c lib/libc/inet/inet_ntop.c
--- a/lib/libc/inet/inet_ntop.c Mon Feb 10 16:29:30 2014 +0000
+++ b/lib/libc/inet/inet_ntop.c Mon Feb 10 16:30:54 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: inet_ntop.c,v 1.10 2014/02/10 16:29:30 christos Exp $ */
+/* $NetBSD: inet_ntop.c,v 1.11 2014/02/10 16:30:54 christos Exp $ */
/*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
@@ -22,7 +22,7 @@
#if 0
static const char rcsid[] = "Id: inet_ntop.c,v 1.5 2005/11/03 22:59:52 marka Exp";
#else
-__RCSID("$NetBSD: inet_ntop.c,v 1.10 2014/02/10 16:29:30 christos Exp $");
+__RCSID("$NetBSD: inet_ntop.c,v 1.11 2014/02/10 16:30:54 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -74,12 +74,12 @@
switch (af) {
case AF_INET:
- return (inet_ntop4(src, dst, size));
+ return inet_ntop4(src, dst, size);
case AF_INET6:
- return (inet_ntop6(src, dst, size));
+ return inet_ntop6(src, dst, size);
default:
errno = EAFNOSUPPORT;
- return (NULL);
+ return NULL;
}
/* NOTREACHED */
}
@@ -106,12 +106,10 @@
l = snprintf(tmp, sizeof(tmp), "%u.%u.%u.%u",
src[0], src[1], src[2], src[3]);
- if (l <= 0 || (socklen_t) l >= size) {
- errno = ENOSPC;
- return (NULL);
- }
+ if (l <= 0 || (socklen_t) l >= size)
+ return NULL;
strlcpy(dst, tmp, size);
- return (dst);
+ return dst;
}
/* const char *
@@ -224,7 +222,7 @@
if ((size_t)(tp - tmp) > size)
goto out;
strlcpy(dst, tmp, size);
- return (dst);
+ return dst;
out:
errno = ENOSPC;
return NULL;
Home |
Main Index |
Thread Index |
Old Index