[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nmh-commits] nmh ./ChangeLog sbr/fmt_scan.c
From: |
Oliver Kiddle |
Subject: |
[Nmh-commits] nmh ./ChangeLog sbr/fmt_scan.c |
Date: |
Wed, 18 Jan 2006 16:43:27 +0000 |
CVSROOT: /cvsroot/nmh
Module name: nmh
Branch:
Changes by: Oliver Kiddle <address@hidden> 06/01/18 16:43:27
Modified files:
. : ChangeLog
sbr : fmt_scan.c
Log message:
fix bug with insertion of newline being wrong if the num function was
used at
the end of the format buffer
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/nmh/nmh/ChangeLog.diff?tr1=1.227&tr2=1.228&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/nmh/nmh/sbr/fmt_scan.c.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
Patches:
Index: nmh/ChangeLog
diff -u nmh/ChangeLog:1.227 nmh/ChangeLog:1.228
--- nmh/ChangeLog:1.227 Wed Jan 18 00:09:00 2006
+++ nmh/ChangeLog Wed Jan 18 16:43:27 2006
@@ -1,3 +1,8 @@
+2006-01-18 Oliver Kiddle <address@hidden>
+
+ * 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 <address@hidden>
* uip/post.c, uip/spost.c: in make_bcc_file (), use same
Index: nmh/sbr/fmt_scan.c
diff -u nmh/sbr/fmt_scan.c:1.20 nmh/sbr/fmt_scan.c:1.21
--- nmh/sbr/fmt_scan.c:1.20 Tue Jan 17 18:06:58 2006
+++ nmh/sbr/fmt_scan.c Wed Jan 18 16:43:27 2006
@@ -2,7 +2,7 @@
/*
* fmt_scan.c -- format string interpretation
*
- * $Id: fmt_scan.c,v 1.20 2006/01/17 18:06:58 opk Exp $
+ * $Id: fmt_scan.c,v 1.21 2006/01/18 16:43:27 opk Exp $
*
* This code is Copyright (c) 2002, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
@@ -342,8 +342,12 @@
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);