Linux /proc/apm: handle hex and decimal (and octal!) values.
authorRyan C. Gordon
Tue, 30 Jun 2009 06:26:02 +0000
changeset 3206f735edf338d3
parent 3205 f9a4aa1e1b34
child 3207 65fdb0961d7c
Linux /proc/apm: handle hex and decimal (and octal!) values.
src/power/linux/SDL_syspower.c
     1.1 --- a/src/power/linux/SDL_syspower.c	Tue Jun 30 05:44:00 2009 +0000
     1.2 +++ b/src/power/linux/SDL_syspower.c	Tue Jun 30 06:26:02 2009 +0000
     1.3 @@ -318,7 +318,7 @@
     1.4  int_string(char *str, int *val)
     1.5  {
     1.6      char *endptr = NULL;
     1.7 -    *val = (int) strtol(str + 2, &endptr, 16);
     1.8 +    *val = (int) strtol(str, &endptr, 0);
     1.9      return ((*str != '\0') && (*endptr == '\0'));
    1.10  }
    1.11