From owner-svn-src-head@freebsd.org Sun Sep 24 05:04:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BBD0E1F281; Sun, 24 Sep 2017 05:04:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3727F69DC3; Sun, 24 Sep 2017 05:04:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8O542xh045577; Sun, 24 Sep 2017 05:04:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8O5424E045576; Sun, 24 Sep 2017 05:04:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201709240504.v8O5424E045576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 24 Sep 2017 05:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323964 - head/contrib/one-true-awk X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/one-true-awk X-SVN-Commit-Revision: 323964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Sep 2017 05:04:03 -0000 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 */