mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-08 19:08:14 +00:00
correct a logic error in the last stringfields commit... don't mark additional space as allocated if the string was built using already-allocated space
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176254 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1298,10 +1298,12 @@ void __ast_string_field_index_build_va(struct ast_string_field_mgr *mgr,
|
||||
vsprintf(target, format, ap2);
|
||||
}
|
||||
|
||||
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,
|
||||
ast_string_field *fields, int num_fields,
|
||||
|
||||
Reference in New Issue
Block a user