diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-09-21 16:29:22 -0700 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-09-21 16:31:01 -0700 |
commit | 4d984d0c05c8517aafa1aefcb73e46c63375ef51 (patch) | |
tree | 4cba1fb4d059195bf51004e9484fa03676efe6d7 | |
parent | a5cdf36c3f8e4bf0aadba1add1ca1f212a8189b0 (diff) | |
download | samba-4d984d0c05c8517aafa1aefcb73e46c63375ef51.tar.gz samba-4d984d0c05c8517aafa1aefcb73e46c63375ef51.tar.bz2 samba-4d984d0c05c8517aafa1aefcb73e46c63375ef51.zip |
s4-ldb: fixed O(n^2) string handling in ldif debug print
-rw-r--r-- | source4/lib/ldb/common/ldb_ldif.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/lib/ldb/common/ldb_ldif.c b/source4/lib/ldb/common/ldb_ldif.c index cde21320a2..b7ab7300b2 100644 --- a/source4/lib/ldb/common/ldb_ldif.c +++ b/source4/lib/ldb/common/ldb_ldif.c @@ -783,7 +783,7 @@ static int ldif_printf_string(void *private_data, const char *fmt, ...) struct ldif_write_string_state *state = (struct ldif_write_string_state *)private_data; va_list ap; - size_t oldlen = strlen(state->string); + size_t oldlen = talloc_get_size(state->string); va_start(ap, fmt); state->string = talloc_vasprintf_append(state->string, fmt, ap); @@ -791,8 +791,8 @@ static int ldif_printf_string(void *private_data, const char *fmt, ...) if (!state->string) { return -1; } - - return strlen(state->string) - oldlen; + + return talloc_get_size(state->string) - oldlen; } char *ldb_ldif_write_string(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, |