From b6e23235f28b1c85e18e9a2b7ba8c6b6c46aecbc Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Wed, 29 Jan 2014 17:00:07 -0500 Subject: bash-4.3-rc2 overlay --- lib/sh/itos.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/sh/itos.c') diff --git a/lib/sh/itos.c b/lib/sh/itos.c index 12e9398d..cd36ef33 100644 --- a/lib/sh/itos.c +++ b/lib/sh/itos.c @@ -50,6 +50,18 @@ itos (i) return (savestring (p)); } +/* Integer to string conversion. This conses the string using strdup; + caller should free it and be prepared to deal with NULL return. */ +char * +mitos (i) + intmax_t i; +{ + char *p, lbuf[INT_STRLEN_BOUND(intmax_t) + 1]; + + p = fmtumax (i, 10, lbuf, sizeof(lbuf), 0); + return (strdup (p)); +} + char * uinttostr (i, buf, len) uintmax_t i; -- cgit v1.2.1