summaryrefslogtreecommitdiff
path: root/tests/util
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2023-03-11 04:45:19 -0800
committerEdward Thomson <ethomson@vercel.com>2023-03-21 09:14:06 +0000
commit0d7f3f52918a00a2a07ba965eb65c6ac5d122867 (patch)
tree4c851a5aea38b0ab01beacbc6284e8ca7a62f8d7 /tests/util
parentcff0d9b1cc2432ab6a6eab777cdfe230ee07fca1 (diff)
downloadlibgit2-0d7f3f52918a00a2a07ba965eb65c6ac5d122867.tar.gz
utf8: add conversion with size and refactor names
Add functions to use convert a string with length, instead of assuming NUL termination. In addition, move the utf8 to 16 conversion routines into the `git_utf8` namespace instead of using namespaceless `git__` prefixed names.
Diffstat (limited to 'tests/util')
-rw-r--r--tests/util/link.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/util/link.c b/tests/util/link.c
index 46cafada7..5909e26e3 100644
--- a/tests/util/link.c
+++ b/tests/util/link.c
@@ -98,7 +98,7 @@ static void do_junction(const char *old, const char *new)
git_str_putc(&unparsed_buf, '\\');
- subst_utf16_len = git__utf8_to_16(NULL, 0, git_str_cstr(&unparsed_buf));
+ subst_utf16_len = git_utf8_to_16(NULL, 0, git_str_cstr(&unparsed_buf));
subst_byte_len = subst_utf16_len * sizeof(WCHAR);
print_utf16_len = subst_utf16_len - 4;
@@ -124,11 +124,11 @@ static void do_junction(const char *old, const char *new)
subst_utf16 = reparse_buf->ReparseBuffer.MountPoint.PathBuffer;
print_utf16 = subst_utf16 + subst_utf16_len + 1;
- ret = git__utf8_to_16(subst_utf16, subst_utf16_len + 1,
+ ret = git_utf8_to_16(subst_utf16, subst_utf16_len + 1,
git_str_cstr(&unparsed_buf));
cl_assert_equal_i(subst_utf16_len, ret);
- ret = git__utf8_to_16(print_utf16,
+ ret = git_utf8_to_16(print_utf16,
print_utf16_len + 1, git_str_cstr(&unparsed_buf) + 4);
cl_assert_equal_i(print_utf16_len, ret);