]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
correct a logic error in the last stringfields commit... don't mark additional space...
authorKevin P. Fleming <kpfleming@digium.com>
Mon, 16 Feb 2009 21:41:46 +0000 (21:41 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Mon, 16 Feb 2009 21:41:46 +0000 (21:41 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176254 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/utils.c

index 84d53e182e135b238891f8bebabc5c453e8acd24..3d3da881ca9e8a3c9fe4c2cd9cb5f8f6314850a7 100644 (file)
@@ -1298,9 +1298,11 @@ void __ast_string_field_index_build_va(struct ast_string_field_mgr *mgr,
                vsprintf(target, format, ap2);
        }
 
-       fields[index] = target;
-       mgr->used += needed;
-       mgr->space -= needed;
+       if (fields[index] != target) {
+               fields[index] = target;
+               mgr->used += needed;
+               mgr->space -= needed;
+       }
 }
 
 void __ast_string_field_index_build(struct ast_string_field_mgr *mgr,