From 966fdc9c293ed28fb2243801090801db8894a59a Mon Sep 17 00:00:00 2001 From: "M. Warner Losh" Date: Sun, 2 Jun 2019 14:53:15 -0600 Subject: [PATCH] Bring in fix from FreeBSD: | r323964 | imp | 2017-09-23 23:04:02 -0600 (Sat, 23 Sep 2017) | 6 lines | | Fix %c for floating values that become 0 when coerced to int. | | Obtained from: OpenBSD run.c 1.36 (From Jeremy Devenport) | Sponsored by: Netflix | Differential Revision: https://reviews.freebsd.org/D12379 --- run.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.c b/run.c index 7ac6c0b..989b8b3 100644 --- a/run.c +++ b/run.c @@ -959,7 +959,7 @@ int format(char **pbuf, int *pbufsize, const char *s, Node *a) /* printf-like co break; case 'c': if (isnum(x)) { - if (getfval(x)) + if ((int)getfval(x)) sprintf(p, fmt, (int) getfval(x)); else { *p++ = '\0'; /* explicit null byte */