From 42dee8ecd78a10c91056ac80fdf0c67a4df57337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Sun, 23 Mar 2014 13:34:33 +0100 Subject: settings: use git_buf for returning strings This survived the last round of culling, as the signature is only in the comments. --- tests/core/env.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests/core') diff --git a/tests/core/env.c b/tests/core/env.c index a32f5ed3e..4383d9695 100644 --- a/tests/core/env.c +++ b/tests/core/env.c @@ -218,7 +218,7 @@ void test_core_env__1(void) static void check_global_searchpath( const char *path, int position, const char *file, git_buf *temp) { - char out[GIT_PATH_MAX]; + git_buf out = GIT_BUF_INIT; /* build and set new path */ if (position < 0) @@ -233,12 +233,12 @@ static void check_global_searchpath( /* get path and make sure $PATH expansion worked */ cl_git_pass(git_libgit2_opts( - GIT_OPT_GET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, out, sizeof(out))); + GIT_OPT_GET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, &out)); if (position < 0) - cl_assert(git__prefixcmp(out, path) == 0); + cl_assert(git__prefixcmp(out.ptr, path) == 0); else if (position > 0) - cl_assert(git__suffixcmp(out, path) == 0); + cl_assert(git__suffixcmp(out.ptr, path) == 0); else cl_assert_equal_s(out, path); @@ -250,6 +250,8 @@ static void check_global_searchpath( GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, NULL)); cl_assert_equal_i( GIT_ENOTFOUND, git_sysdir_find_global_file(temp, file)); + + git_buf_free(&out); } void test_core_env__2(void) -- cgit v1.2.1