Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Sep 2017 05:04:02 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r323964 - head/contrib/one-true-awk
Message-ID:  <201709240504.v8O5424E045576@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Sun Sep 24 05:04:02 2017
New Revision: 323964
URL: https://svnweb.freebsd.org/changeset/base/323964

Log:
  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

Modified:
  head/contrib/one-true-awk/run.c

Modified: head/contrib/one-true-awk/run.c
==============================================================================
--- head/contrib/one-true-awk/run.c	Sun Sep 24 05:03:57 2017	(r323963)
+++ head/contrib/one-true-awk/run.c	Sun Sep 24 05:04:02 2017	(r323964)
@@ -918,7 +918,7 @@ int format(char **pbuf, int *pbufsize, const char *s, 
 			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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709240504.v8O5424E045576>