From: Bruno Haible Date: Tue, 27 Mar 2001 17:04:37 +0000 (+0000) Subject: Improve C format string verification. X-Git-Tag: v0.10.36~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ad603381dcde43947af75f1d43962eaa20c1fb8;p=thirdparty%2Fgettext.git Improve C format string verification. --- diff --git a/src/ChangeLog b/src/ChangeLog index 7a494380d..33f109d0c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2001-03-26 Bruno Haible + + * xgettext.c (test_whether_c_format): Recognize '%%' as valid. + * msgfmt.c (check_pair): In error message, count format + specifications starting from 1, not 0. + 2001-03-25 Bruno Haible * xgettext.c (warn_id_len): Remove unused variable. diff --git a/src/msgfmt.c b/src/msgfmt.c index 35bd4fae4..5d23dc2ac 100644 --- a/src/msgfmt.c +++ b/src/msgfmt.c @@ -1013,7 +1013,7 @@ number of format specifications in `msgid' and `msgstr' does not match")); error_at_line (0, 0, msgid_pos->file_name, msgid_pos->line_number, _("\ format specifications for argument %lu are not the same"), - (unsigned long) cnt); + (unsigned long) (cnt + 1)); exit_status = EXIT_FAILURE; } } diff --git a/src/xgettext.c b/src/xgettext.c index 186b7cd2d..d40c6ce5e 100644 --- a/src/xgettext.c +++ b/src/xgettext.c @@ -1380,7 +1380,7 @@ test_whether_c_format (s) size_t dummy; (void) parse_one_spec (s, 0, &spec, &dummy); - if (strchr ("iduoxXeEfgGcspnm", spec.info.spec) == NULL) + if (strchr ("iduoxXeEfgGcspnm%", spec.info.spec) == NULL) return impossible; }