diff options
author | ache <ache@FreeBSD.org> | 1994-09-24 14:16:04 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1994-09-24 14:16:04 +0000 |
commit | b035e6b80667654a294b7053cf110f28d6dff0cb (patch) | |
tree | f4b7d34be2a588ce896168f156d32f50a193a99f /lib | |
parent | 58acd4e66c3f23a40e9f4d80d8d23557c480592c (diff) | |
download | FreeBSD-src-b035e6b80667654a294b7053cf110f28d6dff0cb.zip FreeBSD-src-b035e6b80667654a294b7053cf110f28d6dff0cb.tar.gz |
Fix bug in %i format, second argument not incremented
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libcurses/tscroll.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libcurses/tscroll.c b/lib/libcurses/tscroll.c index 359b396..a3326a9 100644 --- a/lib/libcurses/tscroll.c +++ b/lib/libcurses/tscroll.c @@ -66,7 +66,7 @@ __tscroll(cap, n1, n2) int n1, n2; { static char result[MAXRETURNSIZE]; - int c, n; + int c, n, increment = 0; char *dp; if (cap == NULL) @@ -94,6 +94,8 @@ __tscroll(cap, n1, n2) two: *dp++ = n / 10 | '0'; one: *dp++ = n % 10 | '0'; n = n2; + if (increment) + n++; continue; case '>': if (n > *cap++) @@ -108,6 +110,7 @@ one: *dp++ = n % 10 | '0'; *dp++ = n; continue; case 'i': + increment = 1; n++; continue; case '%': |