comparison src/power/linux/SDL_syspower.c @ 3206:f735edf338d3

Linux /proc/apm: handle hex and decimal (and octal!) values.
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 30 Jun 2009 06:26:02 +0000
parents f9a4aa1e1b34
children 65fdb0961d7c
comparison
equal deleted inserted replaced
3205:f9a4aa1e1b34 3206:f735edf338d3
316 316
317 static SDL_bool 317 static SDL_bool
318 int_string(char *str, int *val) 318 int_string(char *str, int *val)
319 { 319 {
320 char *endptr = NULL; 320 char *endptr = NULL;
321 *val = (int) strtol(str + 2, &endptr, 16); 321 *val = (int) strtol(str, &endptr, 0);
322 return ((*str != '\0') && (*endptr == '\0')); 322 return ((*str != '\0') && (*endptr == '\0'));
323 } 323 }
324 324
325 /* http://lxr.linux.no/linux+v2.6.29/drivers/char/apm-emulation.c */ 325 /* http://lxr.linux.no/linux+v2.6.29/drivers/char/apm-emulation.c */
326 SDL_bool 326 SDL_bool