summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/util_unistr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c
index 84e4cf3f83..cf040a2dfc 100644
--- a/source3/lib/util_unistr.c
+++ b/source3/lib/util_unistr.c
@@ -484,7 +484,7 @@ size_t strnlen_w(const smb_ucs2_t *src, size_t max)
size_t len;
smb_ucs2_t c;
- for(len = 0; *(COPY_UCS2_CHAR(&c,src)) && (len < max); src++, len++) {
+ for(len = 0; (len < max) && *(COPY_UCS2_CHAR(&c,src)); src++, len++) {
;
}