about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-04-28 14:22:07 +0000
committerUlrich Drepper <drepper@redhat.com>1998-04-28 14:22:07 +0000
commit5005d3b3302adfe379c6f4404f79f204d7c52cdb (patch)
tree3f426c0a5dece375ada36fe2c21ef6eed8eaa505
parent366cff4d8f5c0e6dbfe06eaa1301aa955a848f45 (diff)
downloadglibc-5005d3b3302adfe379c6f4404f79f204d7c52cdb.tar.gz
glibc-5005d3b3302adfe379c6f4404f79f204d7c52cdb.tar.xz
glibc-5005d3b3302adfe379c6f4404f79f204d7c52cdb.zip
Update.
	* inet/ether_aton_r.c (ether_aton_r): Preserve high-nibble value
	in hex conversion.
	* inet/ether_aton.c (ether_aton): Declare result variable static.
	Reported by ahyung@unixg.ubc.ca.
-rw-r--r--ChangeLog5
-rw-r--r--inet/ether_aton.c4
-rw-r--r--inet/ether_aton_r.c4
3 files changed, 9 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 1f0f4d3a7c..866fa203b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 1998-04-28  Ulrich Drepper  <drepper@cygnus.com>
 
+	* inet/ether_aton_r.c (ether_aton_r): Preserve high-nibble value
+	in hex conversion.
+	* inet/ether_aton.c (ether_aton): Declare result variable static.
+	Reported by ahyung@unixg.ubc.ca.
+
 	* sysdeps/unix/sysv/linux/bits/sem.h: Don't define union semun.
 	Define macro _SEM_SEMUN_UNDEFINED instead.
 	Reported by Dirk Laessig <d.laessig@tu-bs.de>.
diff --git a/inet/ether_aton.c b/inet/ether_aton.c
index 20300c806a..574800765a 100644
--- a/inet/ether_aton.c
+++ b/inet/ether_aton.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -24,7 +24,7 @@
 struct ether_addr *
 ether_aton (const char *asc)
 {
-  struct ether_addr result;
+  static struct ether_addr result;
 
   return ether_aton_r (asc, &result);
 }
diff --git a/inet/ether_aton_r.c b/inet/ether_aton_r.c
index 28fe6f6962..14ccd2574f 100644
--- a/inet/ether_aton_r.c
+++ b/inet/ether_aton_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 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 != ':')