From 9a1a8c22e42af12f5859ef5d159b070f959912e6 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 3 Aug 2014 22:03:03 +0300 Subject: Minor code improvement for sprintf %c. --- ChangeLog | 5 +++++ builtin.c | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0072c804..6d7a2dac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-08-03 Arnold D. Robbins + + * builtin.c (format_tree): Don't need to check return value of + wctombr for -2. Thanks to Eli Zaretskii for pointing this out. + 2014-07-31 Arnold D. Robbins * builtin.c (format_tree): Make %c handling more sane on Windows. diff --git a/builtin.c b/builtin.c index 7d314dc5..077575fa 100644 --- a/builtin.c +++ b/builtin.c @@ -1081,8 +1081,7 @@ check_pos: count = wcrtomb(buf, wc, & mbs); if (count == 0 - || count == (size_t)-1 - || count == (size_t)-2) { + || count == (size_t) -1) { if (do_lint) lintwarn( _("[s]printf: value %g is not a valid wide character"), -- cgit v1.2.3