summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/talloc/talloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/lib/talloc/talloc.c b/source4/lib/talloc/talloc.c
index 3650ab7f51..46abd89bac 100644
--- a/source4/lib/talloc/talloc.c
+++ b/source4/lib/talloc/talloc.c
@@ -919,7 +919,7 @@ char *talloc_strndup(const void *t, const char *p, size_t n)
size_t len;
char *ret;
- for (len=0; p[len] && len<n; len++) ;
+ for (len=0; len<n && p[len]; len++) ;
ret = _talloc(t, len + 1);
if (!ret) { return NULL; }