mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-28 05:15:51 +01:00
committed by
Carlos R. Mafra
parent
300d02bf54
commit
14863cd3b1
@@ -314,9 +314,13 @@ unsigned short WMGetColorAlpha(WMColor * color)
|
||||
|
||||
char *WMGetColorRGBDescription(WMColor * color)
|
||||
{
|
||||
char *str = wmalloc(32);
|
||||
char *str = wmalloc(8);
|
||||
|
||||
sprintf(str, "#%02x%02x%02x", color->color.red >> 8, color->color.green >> 8, color->color.blue >> 8);
|
||||
if (snprintf(str, 8, "#%02x%02x%02x",
|
||||
color->color.red >> 8, color->color.green >> 8, color->color.blue >> 8) >= 8) {
|
||||
wfree(str);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user