dwarf.c:11300:3: error: format not a string literal and no format arguments [-Werror=format-security]
11300 | f += sprintf (f, prefix);
PR 28697
* dwarf.c (try_build_id_prefix): Avoid -Wformat-security error.
{
char * f = filename;
- f += sprintf (f, prefix);
- f += sprintf (f, ".build-id/%02x/", (unsigned) *data++);
+ f += sprintf (f, "%s.build-id/%02x/", prefix, (unsigned) *data++);
id_len --;
while (id_len --)
f += sprintf (f, "%02x", (unsigned) *data++);
- f += sprintf (f, ".debug");
+ strcpy (f, ".debug");
return open_debug_file (filename);
}