Fix empty input fields in SWAT; [#5515].
authorAndreas Schneider <anschneider@suse.de>
Tue, 3 Jun 2008 13:26:42 +0000 (15:26 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 3 Jun 2008 13:35:41 +0000 (15:35 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(This used to be commit e1579c90fb27c07f95889dd8778daeef53e2ac16)

source3/web/swat.c

index 3e14d2d0980bde824f2f30dbb2bfcc688b8459d6..373ab73127ef8047c52ace0e9f201f0bb4fd7908 100644 (file)
@@ -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;