*title = NULL;
}
else {
- *title = g_malloc(strlen(errtitle) + 1 + strlen(filename) + 1 + 1);
- sprintf(*title, "%s\"%s\"", errtitle, filename);
+ size_t len = strlen(errtitle) + 1 + strlen(filename) + 1 + 1;
+ *title = g_malloc(len);
+ flac_snprintf(*title, len, "%s\"%s\"", errtitle, filename);
}
} else {
*title = NULL;