#ifdef USE_CAIRO
{
char color_name[30];
- sprintf (color_name, "#%04x%04x%04x",
- (unsigned int) RED16_FROM_ULONG (bg),
- (unsigned int) GREEN16_FROM_ULONG (bg),
- (unsigned int) BLUE16_FROM_ULONG (bg));
+ snprintf (color_name, sizeof color_name, "#%04x%04x%04x",
+ (unsigned int) RED16_FROM_ULONG (bg),
+ (unsigned int) GREEN16_FROM_ULONG (bg),
+ (unsigned int) BLUE16_FROM_ULONG (bg));
bg = image_alloc_image_color (f, img, build_string (color_name), 0);
}
#endif
{
#ifndef USE_CAIRO
char color_name[30];
- sprintf (color_name, "#%04x%04x%04x",
- rgb[0] + 0u, rgb[1] + 0u, rgb[2] + 0u);
+ snprintf (color_name, sizeof color_name, "#%04x%04x%04x",
+ rgb[0] + 0u, rgb[1] + 0u, rgb[2] + 0u);
bg = (
#ifdef HAVE_NTGUI
0x00ffffff & /* Filter out palette info. */
img->background = lookup_rgb_color (f, bg->red, bg->green, bg->blue);
#else /* USE_CAIRO */
char color_name[30];
- sprintf (color_name, "#%04x%04x%04x", bg->red, bg->green, bg->blue);
+ snprintf (color_name, sizeof color_name, "#%04x%04x%04x",
+ bg->red, bg->green, bg->blue);
img->background
= image_alloc_image_color (f, img, build_string (color_name), 0);
#endif /* USE_CAIRO */