/* Make a fontset name from the base font name. */
if (xic_default_fontset == base_fontname)
- { /* There is no base font name, use the default. */
- ptrdiff_t len = strlen (base_fontname) + 2;
- fontsetname = xmalloc (len);
- memset (fontsetname, 0, len);
+ {
+ /* There is no base font name, use the default. */
+ fontsetname = xmalloc (strlen (base_fontname) + 2);
strcpy (fontsetname, base_fontname);
}
else
for (i = 0; *p; p++)
if (*p == '-') i++;
if (i != 14)
- { /* As the font name doesn't conform to XLFD, we can't
+ {
+ /* As the font name doesn't conform to XLFD, we can't
modify it to generalize it to allcs and allfamilies.
Use the specified font plus the default. */
- ptrdiff_t len =
- strlen (base_fontname) + strlen (xic_default_fontset) + 3;
- fontsetname = xmalloc (len);
- memset (fontsetname, 0, len);
+ fontsetname = xmalloc (strlen (base_fontname)
+ + strlen (xic_default_fontset) + 3);
strcpy (fontsetname, base_fontname);
strcat (fontsetname, sep);
strcat (fontsetname, xic_default_fontset);
/* Build the font spec that matches all charsets. */
len = p - base_fontname + strlen (allcs) + 1;
font_allcs = (char *) alloca (len);
- memset (font_allcs, 0, len);
memcpy (font_allcs, base_fontname, p - base_fontname);
strcat (font_allcs, allcs);
add-styles. */
len = p - p1 + strlen (allcs) + strlen (allfamilies) + 1;
font_allfamilies = (char *) alloca (len);
- memset (font_allfamilies, 0, len);
strcpy (font_allfamilies, allfamilies);
memcpy (font_allfamilies + strlen (allfamilies), p1, p - p1);
strcat (font_allfamilies, allcs);
/* Build the font spec that matches all. */
len = p - p2 + strlen (allcs) + strlen (all) + strlen (allfamilies) + 1;
font_all = (char *) alloca (len);
- memset (font_all, 0, len);
strcpy (font_all, allfamilies);
strcat (font_all, all);
memcpy (font_all + strlen (all) + strlen (allfamilies), p2, p - p2);
len = strlen (base_fontname) + strlen (font_allcs)
+ strlen (font_allfamilies) + strlen (font_all) + 5;
fontsetname = xmalloc (len);
- memset (fontsetname, 0, len);
strcpy (fontsetname, base_fontname);
strcat (fontsetname, sep);
strcat (fontsetname, font_allcs);