summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-17 10:13:32 -0800
committerJunio C Hamano <gitster@pobox.com>2016-02-17 10:13:32 -0800
commit790dd332c6986693b731211e49479c74c8a1894c (patch)
treeb60c30af6a791ae6a238403b9037e0c78e8d1085
parentc37f9a1bc38cad56c9eca40014802e7cd822c21c (diff)
parent7b11a18a2ee04380c1c698635f1ef2c4eb3324fb (diff)
downloadgit-790dd332c6986693b731211e49479c74c8a1894c.tar.gz
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
-rw-r--r--test-path-utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test-path-utils.c b/test-path-utils.c
index c3adcd87b8..6232dfe661 100644
--- a/test-path-utils.c
+++ b/test-path-utils.c
@@ -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))