summaryrefslogtreecommitdiff
path: root/usr.bin/less/output.c
diff options
context:
space:
mode:
authormmcc <mmcc@cvs.openbsd.org>2016-01-26 01:51:07 +0000
committermmcc <mmcc@cvs.openbsd.org>2016-01-26 01:51:07 +0000
commit3d07d7ebe703b072989602501769f3c219916307 (patch)
tree120b14117cacabc5cf8bb6293e1312035712caf7 /usr.bin/less/output.c
parent2f0cea4cfa2bf18abda659384bc1830bdfec8303 (diff)
Remove a fancy macro that calculates the necessary buffer size for
int-to-str conversions and just use constants instead. The only binary change is caused by using an unnecessarily large buffer for an int. This is a consequence of simplifying some code that will be gone soon. ok nicm@
Diffstat (limited to 'usr.bin/less/output.c')
-rw-r--r--usr.bin/less/output.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/less/output.c b/usr.bin/less/output.c
index 8110a1a27e5..eaad99088f9 100644
--- a/usr.bin/less/output.c
+++ b/usr.bin/less/output.c
@@ -135,7 +135,7 @@ void \
funcname(type num, char *buf, size_t len) \
{ \
int neg = (num < 0); \
- char tbuf[INT_STRLEN_BOUND(num)+2]; \
+ char tbuf[23]; \
char *s = tbuf + sizeof (tbuf); \
if (neg) \
num = -num; \
@@ -157,7 +157,7 @@ TYPE_TO_A_FUNC(inttoa, int)
static int
iprint_int(int num)
{
- char buf[INT_STRLEN_BOUND(num)];
+ char buf[11];
inttoa(num, buf, sizeof (buf));
putstr(buf);
@@ -170,7 +170,7 @@ iprint_int(int num)
static int
iprint_linenum(off_t num)
{
- char buf[INT_STRLEN_BOUND(num)];
+ char buf[21];
postoa(num, buf, sizeof(buf));
putstr(buf);