diff options
author | 2016-08-04 09:27:27 -0400 | |
---|---|---|
committer | 2016-08-04 09:27:27 -0400 | |
commit | 4b0de51766f78b1783528a43fe56300c7f4b50f2 (patch) | |
tree | e20308d24c632ab4150ef432adb1428233bbf3bc /common/util.c | |
parent | Merge pull request #830 from acrisci/feature/simplify-set-focus (diff) | |
parent | common: use strtoul in parse_color to avoid clamp (diff) | |
download | sway-4b0de51766f78b1783528a43fe56300c7f4b50f2.tar.gz sway-4b0de51766f78b1783528a43fe56300c7f4b50f2.tar.zst sway-4b0de51766f78b1783528a43fe56300c7f4b50f2.zip |
Merge pull request #831 from progandy/fix_colors
common: use strtoul in parse_color to avoid clamp
Diffstat (limited to 'common/util.c')
-rw-r--r-- | common/util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/util.c b/common/util.c index 86120769..f0b0fdf0 100644 --- a/common/util.c +++ b/common/util.c | |||
@@ -104,7 +104,7 @@ uint32_t parse_color(const char *color) { | |||
104 | sway_log(L_DEBUG, "Invalid color %s, defaulting to color 0xFFFFFFFF", color); | 104 | sway_log(L_DEBUG, "Invalid color %s, defaulting to color 0xFFFFFFFF", color); |
105 | return 0xFFFFFFFF; | 105 | return 0xFFFFFFFF; |
106 | } | 106 | } |
107 | uint32_t res = (uint32_t)strtol(color + 1, NULL, 16); | 107 | uint32_t res = (uint32_t)strtoul(color + 1, NULL, 16); |
108 | if (strlen(color) == 7) { | 108 | if (strlen(color) == 7) { |
109 | res = (res << 8) | 0xFF; | 109 | res = (res << 8) | 0xFF; |
110 | } | 110 | } |