mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-12-30 14:31:04 +00:00
Do not pass negative sizes to strncat or strncmp in tests.
These parameters are of type size_t, which is unsigned.
This commit is contained in:
parent
84fdb5c975
commit
ce94f4e2b6
@ -34,7 +34,7 @@ second string argument!"))
|
|||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
strcpy(s1, "this is the first string argument");
|
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"))
|
if (strcmp (s1, "this is the first string argument"))
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ int main (void)
|
|||||||
if (i != 0)
|
if (i != 0)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
i = strncmp (s1, s2, -90L); /* should just return 0 */
|
i = strncmp (s1, s2, 0L); /* should just return 0 */
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
goto Fail;
|
goto Fail;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user