From 74fc8092d5717517b31bd88c1fe32963d2b02392 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 3 Jun 2008 15:26:42 +0200 Subject: [PATCH] Fix empty input fields in SWAT; [#5515]. --- source/web/swat.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/web/swat.c b/source/web/swat.c index 6d8f4ca..6c6d78e 100644 --- a/source/web/swat.c +++ b/source/web/swat.c @@ -86,13 +86,14 @@ static const char *fix_quotes(TALLOC_CTX *ctx, const char *str) /* Count the number of quotes. */ newstring_len = 1; - while (*str) { - if ( *str == '\"') { + p = (char *) str; + while (*p) { + if ( *p == '\"') { newstring_len += quote_len; } else { newstring_len++; } - ++str; + ++p; } newstring = TALLOC_ARRAY(ctx, char, newstring_len); if (!newstring) { @@ -105,7 +106,6 @@ static const char *fix_quotes(TALLOC_CTX *ctx, const char *str) } else { *p++ = *str; } - ++str; } *p = '\0'; return newstring; -- 1.5.4.5