use sprintf

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@556 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-11-01 08:44:05 +00:00
parent 14be6d3bca
commit ac87fbdd35

View File

@@ -111,13 +111,13 @@ static void color_picker_click(MwWidget handle, void* user, void* call) {
hexColor = malloc(8);
fgColor = malloc(8);
snprintf(hexColor, 8, "#%02X%02X%02X", r, g, b);
sprintf(hexColor, "#%02X%02X%02X", r, g, b);
fr = r > 128 ? 0 : 255;
fg = g > 128 ? 0 : 255;
fb = b > 128 ? 0 : 255;
snprintf(fgColor, 8, "#%02X%02X%02X", fr, fg, fb);
sprintf(fgColor, "#%02X%02X%02X", fr, fg, fb);
MwSetText(picker->inner.color_display, MwNbackground, hexColor);
MwSetText(picker->inner.color_display_text, MwNforeground, fgColor);