mirror of
https://github.com/labwc/labwc.git
synced 2026-04-13 08:21:15 -04:00
Code style
This commit is contained in:
parent
6038c87d03
commit
ea3674faf0
2 changed files with 17 additions and 8 deletions
|
|
@ -749,10 +749,19 @@ set_adaptive_sync_mode(const char *str, enum adaptive_sync_mode *variable)
|
|||
static bool parse_rgb(const char *str, int *r, int *g, int *b)
|
||||
{
|
||||
int rr, rg, rb;
|
||||
if (!str) return false;
|
||||
if (strlen(str) != 7) return false;
|
||||
if (str[0] != '#') return false;
|
||||
if (sscanf(str, "#%2X%2X%2X", &rr, &rg, &rb) != 3) return false;
|
||||
|
||||
if (!str) {
|
||||
return false;
|
||||
}
|
||||
if (strlen(str) != 7) {
|
||||
return false;
|
||||
}
|
||||
if (str[0] != '#') {
|
||||
return false;
|
||||
}
|
||||
if (sscanf(str, "#%2X%2X%2X", &rr, &rg, &rb) != 3) {
|
||||
return false;
|
||||
}
|
||||
*r = rr;
|
||||
*g = rg;
|
||||
*b = rb;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue