Fix core dump from (format "%#08x" n) patch

Problem reported by Glenn Morris (Bug#29609#13).
* src/editfns.c (styled_format): Null-terminate output,
as later code now expects this.
This commit is contained in:
Paul Eggert 2017-12-08 13:30:06 -08:00
parent ff105b366c
commit 7367ea4fc7

View file

@ -4623,6 +4623,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
/* Don't use sprintf here, as it might mishandle prec. */
sprintf_buf[0] = XINT (arg);
sprintf_bytes = prec != 0;
sprintf_buf[sprintf_bytes] = '\0';
}
else if (conversion == 'd' || conversion == 'i')
{