Skip to content

Commit

Permalink
Merge branch 'jk/test-path-utils-xsnprintf'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Junio C Hamano committed Feb 17, 2016
2 parents c37f9a1 + 7b11a18 commit 790dd33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test-path-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 790dd33

Please sign in to comment.