From ce94f4e2b6e1fda8636ff235b888f4ab210abd98 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sat, 24 Feb 2024 18:57:50 -0600 Subject: [PATCH] Do not pass negative sizes to strncat or strncmp in tests. These parameters are of type size_t, which is unsigned. --- Tests/Conformance/C15.1.0.1.CC | 2 +- Tests/Conformance/C15.2.0.1.CC | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Conformance/C15.1.0.1.CC b/Tests/Conformance/C15.1.0.1.CC index 3cdc9eb..1800a02 100644 --- a/Tests/Conformance/C15.1.0.1.CC +++ b/Tests/Conformance/C15.1.0.1.CC @@ -34,7 +34,7 @@ second string argument!")) goto Fail; strcpy(s1, "this is the first string argument"); - strcpy(s1, strncat (s1, s2, -5)); + strcpy(s1, strncat (s1, s2, 0)); if (strcmp (s1, "this is the first string argument")) goto Fail; diff --git a/Tests/Conformance/C15.2.0.1.CC b/Tests/Conformance/C15.2.0.1.CC index 6ba0391..2984994 100644 --- a/Tests/Conformance/C15.2.0.1.CC +++ b/Tests/Conformance/C15.2.0.1.CC @@ -29,7 +29,7 @@ int main (void) if (i != 0) goto Fail; - i = strncmp (s1, s2, -90L); /* should just return 0 */ + i = strncmp (s1, s2, 0L); /* should just return 0 */ if (i != 0) goto Fail;