the end of the format buffer
+2006-01-18 Oliver Kiddle <okiddle@yahoo.co.uk>
+
+ * sbr/fmt_scan.c: fix bug with insertion of newline being wrong if
+ the num function was used at the end of the format buffer
+
2006-01-17 David Levine <levinedl@acm.org>
* uip/post.c, uip/spost.c: in make_bcc_file (), use same
adios (NULL, "internal error (FT_STRFW)");
case FT_NUM:
- n = snprintf(cp, ep - cp, "%d", value);
- if (n >= 0) cp += n;
+ n = snprintf(cp, ep - cp + 1, "%d", value);
+ if (n >= 0)
+ if (n >= ep - cp) {
+ cp = ep;
+ } else
+ cp += n;
break;
case FT_NUMF:
cpnumber (&cp, value, fmt->f_width, fmt->f_fill, ep - cp);