]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(ether_aton_r): Preserve high-nibble value in hex conversion.
authorUlrich Drepper <drepper@redhat.com>
Tue, 28 Apr 1998 14:22:37 +0000 (14:22 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 28 Apr 1998 14:22:37 +0000 (14:22 +0000)
inet/ether_aton_r.c

index 4b38f034cc912d400cb132674a44864c5723cafe..e82cb21817df492d0c8d32cb2071dc6413fcbd87 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1998 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -45,7 +45,7 @@ ether_aton_r (const char *asc, struct ether_addr *addr)
          if ((ch < '0' || ch > '9') && (ch < 'a' || ch > 'f'))
            return NULL;
          number <<= 4;
-         number = isdigit (ch) ? (ch - '0') : (ch - 'a' + 10);
+         number += isdigit (ch) ? (ch - '0') : (ch - 'a' + 10);
 
          ch = *asc;
          if (cnt < 5 && ch != ':')