diff options
author | 2014-12-01 03:18:50 +0000 | |
---|---|---|
committer | 2014-12-01 03:18:50 +0000 | |
commit | 22b119ec565066f4f7842fece69b6ece6f2e43d8 (patch) | |
tree | 7a38a1aeca5d0e3a811bfcabccf3f1303232ad98 | |
parent | Use warnc() to use the correct errno value for FTS_DNR, FTS_NS and (diff) | |
download | wireguard-openbsd-22b119ec565066f4f7842fece69b6ece6f2e43d8.tar.xz wireguard-openbsd-22b119ec565066f4f7842fece69b6ece6f2e43d8.zip |
Fix %c for floating values that become 0 when coerced to int.
From Jeremy Devenport
-rw-r--r-- | usr.bin/awk/run.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/awk/run.c b/usr.bin/awk/run.c index 9e8bb42aba7..5f8c885fbf6 100644 --- a/usr.bin/awk/run.c +++ b/usr.bin/awk/run.c @@ -1,4 +1,4 @@ -/* $OpenBSD: run.c,v 1.35 2014/10/11 03:07:29 doug Exp $ */ +/* $OpenBSD: run.c,v 1.36 2014/12/01 03:18:50 millert Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved @@ -921,7 +921,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)) snprintf(p, buf + bufsize - p, fmt, (int) getfval(x)); else { *p++ = '\0'; /* explicit null byte */ |