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:
parent
c70b9fe882
commit
966fdc9c29
2
run.c
2
run.c
@ -959,7 +959,7 @@ int format(char **pbuf, int *pbufsize, const char *s, Node *a) /* printf-like co
|
|||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
if (isnum(x)) {
|
if (isnum(x)) {
|
||||||
if (getfval(x))
|
if ((int)getfval(x))
|
||||||
sprintf(p, fmt, (int) getfval(x));
|
sprintf(p, fmt, (int) getfval(x));
|
||||||
else {
|
else {
|
||||||
*p++ = '\0'; /* explicit null byte */
|
*p++ = '\0'; /* explicit null byte */
|
||||||
|
Loading…
Reference in New Issue
Block a user