Skip to content
This repository was archived by the owner on Oct 13, 2020. It is now read-only.

Commit 72afe30

Browse files
committed
no need to append \0 in TestSuite.c
1 parent b10532b commit 72afe30

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

tests/TestSuite.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,6 @@ TestSuite_RunTest (TestSuite *suite, /* IN */
435435
int status = 0;
436436

437437
snprintf (name, sizeof name, "%s%s", suite->name, test->name);
438-
name[sizeof name - 1] = '\0';
439438

440439
for (i = 0; i < test->num_checks; i++) {
441440
if (!test->checks[i] ()) {
@@ -446,7 +445,6 @@ TestSuite_RunTest (TestSuite *suite, /* IN */
446445
" { \"status\": \"SKIP\", \"test_file\": \"%s\" }%s\n",
447446
test->name,
448447
((*count) == 1) ? "" : ",");
449-
buf[sizeof buf - 1] = '\0';
450448
_Print_StdOut ("%s", buf);
451449
if (suite->outfile) {
452450
fprintf (suite->outfile, "%s", buf);
@@ -509,7 +507,6 @@ TestSuite_RunTest (TestSuite *suite, /* IN */
509507
(unsigned) ts3.tv_sec,
510508
(unsigned) ts3.tv_nsec,
511509
((*count) == 1) ? "" : ",");
512-
buf[sizeof buf - 1] = 0;
513510
_Print_StdOut ("%s", buf);
514511
if (suite->outfile) {
515512
fprintf (suite->outfile, "%s", buf);
@@ -802,7 +799,6 @@ TestSuite_RunNamed (TestSuite *suite, /* IN */
802799

803800
for (test = suite->tests; test; test = test->next) {
804801
snprintf (name, sizeof name, "%s%s", suite->name, test->name);
805-
name[sizeof name - 1] = '\0';
806802
if (star) {
807803
/* e.g. testname is "/Client*" and name is "/Client/authenticate" */
808804
match = (0 == strncmp (name, testname, strlen (testname) - 1));

0 commit comments

Comments
 (0)