summaryrefslogtreecommitdiff
path: root/lib/libc/net/ntohl.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/net/ntohl.c')
-rw-r--r--lib/libc/net/ntohl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/net/ntohl.c b/lib/libc/net/ntohl.c
index 05b7f4c9a31..5df37075ac6 100644
--- a/lib/libc/net/ntohl.c
+++ b/lib/libc/net/ntohl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ntohl.c,v 1.5 1995/04/28 23:25:21 jtc Exp $ */
+/* $NetBSD: ntohl.c,v 1.5.6.1 1996/05/29 23:28:26 cgd Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
@@ -6,7 +6,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$NetBSD: ntohl.c,v 1.5 1995/04/28 23:25:21 jtc Exp $";
+static char *rcsid = "$NetBSD: ntohl.c,v 1.5.6.1 1996/05/29 23:28:26 cgd Exp $";
#endif
#include <sys/types.h>
@@ -22,7 +22,7 @@ ntohl(x)
#if BYTE_ORDER == LITTLE_ENDIAN
u_char *s = (u_char *)&y;
- return s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3];
+ return (u_int32_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]);
#else
return y;
#endif