diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2020-11-22 09:43:06 +0000 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2020-11-25 11:42:07 +0000 |
commit | 7b185b83dddde4aa6d1fd6c158c115b618e0814d (patch) | |
tree | 91f8db499feb0e2e60994fc506cf690943b2a724 /src/win32/path_w32.c | |
parent | c7d607992319c0b117f07960b973bf7cd63fe90f (diff) | |
download | libgit2-ethomson/assert.tar.gz |
win32: use GIT_ASSERTethomson/assert
Diffstat (limited to 'src/win32/path_w32.c')
-rw-r--r-- | src/win32/path_w32.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/win32/path_w32.c b/src/win32/path_w32.c index 9faddcf3b..23efd9269 100644 --- a/src/win32/path_w32.c +++ b/src/win32/path_w32.c @@ -492,14 +492,12 @@ size_t git_win32_path_remove_namespace(wchar_t *str, size_t len) prefix_len = CONST_STRLEN(unc_prefix); } - if (remainder) { - /* - * Sanity check that the new string isn't longer than the old one. - * (This could only happen due to programmer error introducing a - * prefix longer than the namespace it replaces.) - */ - assert(len >= remainder_len + prefix_len); - + /* + * Sanity check that the new string isn't longer than the old one. + * (This could only happen due to programmer error introducing a + * prefix longer than the namespace it replaces.) + */ + if (remainder && len >= remainder_len + prefix_len) { if (prefix) memmove(str, prefix, prefix_len * sizeof(wchar_t)); |