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