]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
java-printf-format: Reject null precision.
authorBruno Haible <bruno@clisp.org>
Sat, 21 Jun 2025 23:12:35 +0000 (01:12 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 21 Jun 2025 23:12:35 +0000 (01:12 +0200)
Proof that it's invalid:
--------------------------- foo.java ---------------------------
public class foo {
  public static void main(String[] args) {
    System.out.println(String.format("%.f\n", 3.1415926535));
  }
}
----------------------------------------------------------------

* gettext-tools/tests/format-java-printf-1: Add a test case with null precision.

gettext-tools/tests/format-java-printf-1

index 37d4d0d1673c94f9f806f4a559c45086bff63987..153532939e6aee838928c546a781fccf58abe4b9 100755 (executable)
@@ -66,6 +66,8 @@ cat <<\EOF > f-jp-1.data
 "abc%y"
 # Invalid: flags after width
 "abc%2#d"
+# Invalid: null precision
+"abc%.f"
 # Invalid: twice precision
 "abc%.4.2g"
 # Valid: three arguments