summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/nsap_addr.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libc/net/nsap_addr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libc/net/nsap_addr.c b/src/lib/libc/net/nsap_addr.c
index 50e3bdda95..8cfe86f475 100644
--- a/src/lib/libc/net/nsap_addr.c
+++ b/src/lib/libc/net/nsap_addr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: nsap_addr.c,v 1.6 2005/08/06 20:30:03 espie Exp $ */ 1/* $OpenBSD: nsap_addr.c,v 1.7 2006/03/31 05:35:44 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 by Internet Software Consortium. 4 * Copyright (c) 1996 by Internet Software Consortium.
@@ -25,7 +25,7 @@
25#include <ctype.h> 25#include <ctype.h>
26#include <resolv.h> 26#include <resolv.h>
27 27
28static char 28static u_char
29xtob(int c) 29xtob(int c)
30{ 30{
31 return (c - (((c >= '0') && (c <= '9')) ? '0' : '7')); 31 return (c - (((c >= '0') && (c <= '9')) ? '0' : '7'));
@@ -43,11 +43,11 @@ inet_nsap_addr(const char *ascii, u_char *binary, int maxlen)
43 if (!isascii(c)) 43 if (!isascii(c))
44 return (0); 44 return (0);
45 if (islower(c)) 45 if (islower(c))
46 c = toupper(c); 46 c = (u_char)toupper(c);
47 if (isxdigit(c)) { 47 if (isxdigit(c)) {
48 nib = xtob(c); 48 nib = xtob(c);
49 if ((c = *ascii++)) { 49 if ((c = *ascii++)) {
50 c = toupper(c); 50 c = (u_char)toupper(c);
51 if (isxdigit(c)) { 51 if (isxdigit(c)) {
52 *binary++ = (nib << 4) | xtob(c); 52 *binary++ = (nib << 4) | xtob(c);
53 len++; 53 len++;