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
This commit is contained in:
M. Warner Losh 2019-06-02 14:53:15 -06:00 committed by Arnold D. Robbins
parent c70b9fe882
commit 966fdc9c29

2
run.c
View File

@ -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 */