mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Merge pull request #831 from progandy/fix_colors
common: use strtoul in parse_color to avoid clamp
This commit is contained in:
		
						commit
						4b0de51766
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -104,7 +104,7 @@ uint32_t parse_color(const char *color) {
 | 
				
			||||||
		sway_log(L_DEBUG, "Invalid color %s, defaulting to color 0xFFFFFFFF", color);
 | 
							sway_log(L_DEBUG, "Invalid color %s, defaulting to color 0xFFFFFFFF", color);
 | 
				
			||||||
		return 0xFFFFFFFF;
 | 
							return 0xFFFFFFFF;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	uint32_t res = (uint32_t)strtol(color + 1, NULL, 16);
 | 
						uint32_t res = (uint32_t)strtoul(color + 1, NULL, 16);
 | 
				
			||||||
	if (strlen(color) == 7) {
 | 
						if (strlen(color) == 7) {
 | 
				
			||||||
		res = (res << 8) | 0xFF;
 | 
							res = (res << 8) | 0xFF;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue