Show
Ignore:
Timestamp:
04/24/08 14:34:51 (7 years ago)
Author:
khali
Message:

Move the chip address parsing to a common function for consistency.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • i2c-tools/trunk/tools/i2cset.c

    r5203 r5204  
    8484                help(); 
    8585 
    86         address = strtol(argv[flags+2], &end, 0); 
    87         if (*end || address < 0x03 || address > 0x77) { 
    88                 fprintf(stderr, "Error: Chip address invalid!\n"); 
    89                 help(); 
    90         } 
     86        address = parse_i2c_address(argv[flags+2]); 
     87        if (address < 0) 
     88                help(); 
    9189 
    9290        daddress = strtol(argv[flags+3], &end, 0);