case IMAGE_MONO_PIXMAP:
case IMAGE_COLOR_PIXMAP:
case IMAGE_POINTER:
- sprintf(buf, " (0x%lx",
- (unsigned long)IMAGE_INSTANCE_GTK_PIXMAP(p));
- write_c_string(buf, printcharfun);
+ write_fmt_str(printcharfun, " (0x%lx",
+ (unsigned long)IMAGE_INSTANCE_GTK_PIXMAP(p));
if (IMAGE_INSTANCE_GTK_MASK(p)) {
- sprintf(buf, "/0x%lx",
- (unsigned long)IMAGE_INSTANCE_GTK_MASK(p));
- write_c_string(buf, printcharfun);
+ write_fmt_str(printcharfun, "/0x%lx",
+ (unsigned long)IMAGE_INSTANCE_GTK_MASK(p));
}
write_c_string(")", printcharfun);
break;
!ascii_strcasecmp(color_symbols[i].name,
image.colorTable[j].
symbolic)) {
+ int maxLen = 16, sz;
image.colorTable[j].c_color =
- xmalloc(16);
-
- sprintf(image.colorTable[j].c_color,
- "#%.4x%.4x%.4x",
- color_symbols[i].color.red,
- color_symbols[i].color.green,
- color_symbols[i].color.blue);
+ xmalloc(maxLen);
+
+ sz = snprintf(image.colorTable[j].c_color,
+ maxLen, "#%.4x%.4x%.4x",
+ color_symbols[i].color.red,
+ color_symbols[i].color.green,
+ color_symbols[i].color.blue);
+ assert( sz >= 0 && sz < maxLen);
}
}
}