View | Details | Raw Unified | Return to bug 18750 | Differences between
and this patch

Collapse All | Expand All

(-)a/bfd/ihex.c (-3 / +9 lines)
Lines 216-225 ihex_bad_byte (bfd *abfd, unsigned int lineno, int c, bfd_boolean error) Link Here
216
    }
216
    }
217
  else
217
  else
218
    {
218
    {
219
      char buf[10];
219
      char buf[1 + 11 + 1]; /* '\\' + "37777777777" + '\0' */
220
220
221
      if (! ISPRINT (c))
221
      if (! ISPRINT (c))
222
	sprintf (buf, "\\%03o", (unsigned int) c);
222
      {
223
	int len = snprintf (buf, sizeof(buf), "\\%03o", (unsigned int) c);
224
225
	if (len < 0 || (unsigned int) len >= sizeof(buf)) {
226
		buf[0] = '?';
227
		buf[1] = '\0';
228
	}
229
      }
223
      else
230
      else
224
	{
231
	{
225
	  buf[0] = c;
232
	  buf[0] = c;
226
- 

Return to bug 18750