Browse Source

Merge branch 'jk/test-path-utils-xsnprintf'

Some calls to strcpy(3) triggers a false warning from static
analysers that are less intelligent than humans, and reducing the
number of these false hits helps us notice real issues.  A few
calls to strcpy(3) in test-path-utils that are already safe has
been rewritten to avoid false wanings.

* jk/test-path-utils-xsnprintf:
  test-path-utils: use xsnprintf in favor of strcpy
maint
Junio C Hamano 9 years ago
parent
commit
790dd332c6
  1. 2
      test-path-utils.c

2
test-path-utils.c

@ -56,7 +56,7 @@ static int test_function(struct test_data *data, char *(*func)(char *input), @@ -56,7 +56,7 @@ static int test_function(struct test_data *data, char *(*func)(char *input),
if (!data[i].from)
to = func(NULL);
else {
strcpy(buffer, data[i].from);
xsnprintf(buffer, sizeof(buffer), "%s", data[i].from);
to = func(buffer);
}
if (!strcmp(to, data[i].to))

Loading…
Cancel
Save