]> git.sur5r.net Git - u-boot/commitdiff
net/eth.c: Fix env_enetaddr signed overflow
authorShinya Kuribayashi <shinya.kuribayashi@necel.com>
Mon, 19 Nov 2007 11:27:04 +0000 (20:27 +0900)
committerBen Warren <biggerbadderben@gmail.com>
Fri, 4 Jan 2008 03:37:13 +0000 (22:37 -0500)
Assigning the output of simple_strtoul(CB:A9:87:65:43:21) to `char', we are
warned as below:

  U-Boot 1.2.0 (Aug 30 2007 - 08:27:37)

  DRAM:  256 MB
  Flash: 32 MB
  In:    serial
  Out:   serial
  Err:   serial
  Net:   NEC-Candy
  Warning: NEC-Candy MAC addresses don't match:
  Address in SROM is         00:00:4C:80:92:A2
  Address in environment is  FFFFFFCB:FFFFFFA9:FFFFFF87:65:43:21

This patch changes env_enetaddr type from `char' to `unsigned char'.

Cc: Masaki Ishikawa <ishikawa-masaki@cnt.mxe.nes.nec.co.jp>
Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
net/eth.c

index 4657f7970f6b37acf326d61c22ea778a746cd991..425f29edba4a7c73b421fd70fec1fc70813edf2b 100644 (file)
--- a/net/eth.c
+++ b/net/eth.c
@@ -149,7 +149,8 @@ int eth_register(struct eth_device* dev)
 
 int eth_initialize(bd_t *bis)
 {
-       char enetvar[32], env_enetaddr[6];
+       char enetvar[32];
+       unsigned char env_enetaddr[6];
        int i, eth_number = 0;
        char *tmp, *end;