@@ -1,3 +1,7 @@
+2024-11-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ * printf now diagnoses attempts to treat empty strings as numbers.
+
2014-11-17 Stéphane Aulery <saulery@free.fr>
* Correct typo in manual page.
@@ -540,11 +540,11 @@ getdouble(void)
static void
check_conversion(const char *s, const char *ep)
{
- if (*ep) {
- if (ep == s)
- warnx("%s: expected numeric value", s);
- else
- warnx("%s: not completely converted", s);
+ if (ep == s) {
+ warnx("%s: expected numeric value", s);
+ rval = 1;
+ } else if (*ep) {
+ warnx("%s: not completely converted", s);
rval = 1;
} else if (errno == ERANGE) {
warnx("%s: %s", s, strerror(ERANGE));