*BSD News Article 83309


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.Hawaii.Edu!ames!purdue!mozo.cc.purdue.edu!schwinger.physics.purdue.edu!ajk
From: ajk@schwinger.physics.purdue.edu (Andrew J. Korty)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Bug in ether_aton()
Date: 20 Nov 1996 22:45:55 GMT
Organization: Physics Department, Purdue University
Lines: 23
Message-ID: <5701n3$ks9@mozo.cc.purdue.edu>
NNTP-Posting-Host: schwinger.physics.purdue.edu

Is there a bug in the ether_aton() library call?  The following diff
shows what it seems like it should be.

ajk


*** ether_addr.c	Wed Nov 20 17:39:58 1996
--- ajk_ether_addr.c	Wed Nov 20 17:41:59 1996
***************
*** 92,97 ****
  	static struct ether_addr o;
  
!         i = sscanf(a, "%x:%x:%x:%x:%x:%x", o.octet[0], o.octet[1], o.octet[2],
!                                            o.octet[3], o.octet[4], o.octet[5]);
          if (i != 6)
                  return (NULL);
--- 92,97 ----
  	static struct ether_addr o;
  
!         i = sscanf(a, "%x:%x:%x:%x:%x:%x", &o.octet[0], &o.octet[1],
!                 &o.octet[2], &o.octet[3], &o.octet[4], &o.octet[5]);
          if (i != 6)
                  return (NULL);