summaryrefslogtreecommitdiff
path: root/src/win32/path_w32.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-11-22 09:43:06 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2020-11-25 11:42:07 +0000
commit7b185b83dddde4aa6d1fd6c158c115b618e0814d (patch)
tree91f8db499feb0e2e60994fc506cf690943b2a724 /src/win32/path_w32.c
parentc7d607992319c0b117f07960b973bf7cd63fe90f (diff)
downloadlibgit2-ethomson/assert.tar.gz
win32: use GIT_ASSERTethomson/assert
Diffstat (limited to 'src/win32/path_w32.c')
-rw-r--r--src/win32/path_w32.c14
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));