* src/comp.c (format_string): Prefer strcpy to doing things by hand
in a place where strcpy is easier to read, generates
more-efficient code, and similar parts of Emacs do strcpy.
(cherry picked from commit
f8b8dddce90f5cbf6ca0be2e72b4e11cdcf581fe)
va_start (va, format);
int res = vsnprintf (scratch_area, sizeof (scratch_area), format, va);
if (res >= sizeof (scratch_area))
- {
- scratch_area[sizeof (scratch_area) - 4] = '.';
- scratch_area[sizeof (scratch_area) - 3] = '.';
- scratch_area[sizeof (scratch_area) - 2] = '.';
- }
+ strcpy (scratch_area + sizeof scratch_area - 4, "...");
va_end (va);
return scratch_area;
}