diff options
author | Warner Losh <imp@FreeBSD.org> | 2017-09-24 05:04:02 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2017-09-24 05:04:02 +0000 |
commit | 8e537f8ae00e8a8002ae589c44b71b6edb08da49 (patch) | |
tree | f19a48635a68ee4644c5f3edfd29f407da836e09 /contrib/one-true-awk | |
parent | 547f34cace39b156d68197bf9ecbe0edfeec5084 (diff) | |
download | src-8e537f8ae00e8a8002ae589c44b71b6edb08da49.tar.gz src-8e537f8ae00e8a8002ae589c44b71b6edb08da49.zip |
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
Notes
Notes:
svn path=/head/; revision=323964
Diffstat (limited to 'contrib/one-true-awk')
-rw-r--r-- | contrib/one-true-awk/run.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/one-true-awk/run.c b/contrib/one-true-awk/run.c index 743e62a91e7b..1b02a79fb46b 100644 --- a/contrib/one-true-awk/run.c +++ b/contrib/one-true-awk/run.c @@ -918,7 +918,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 */ |