diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -34,8 +34,8 @@ void writecolor(int r, int g, int b) { /** * load_current_state: - * Loads the current color state from the keyboard's sys file at - * /sys/class/leds/*kbd_backlight/.. + * Loads the current color state from the keyboard's sys file defined with + * COLORFILE * * @r Pointer to red int buffer * @g Pointer to green int buffer @@ -56,15 +56,15 @@ int load_current_state(int* r, int* g, int* b) { chan[0] = fgetc(fd); chan[1] = fgetc(fd); - *r = atoi(chan); + *r = strtol(chan, NULL, 16); chan[0] = fgetc(fd); chan[1] = fgetc(fd); - *g = atoi(chan); + *g = strtol(chan, NULL, 16); chan[0] = fgetc(fd); chan[1] = fgetc(fd); - *b = atoi(chan); + *b = strtol(chan, NULL, 16); fclose(fd); return 0; |