Files
asterisk/include/asterisk
Mark Michelson 2ce7eabb24 Fix two problems in ast_str functions found while writing a unit test.
1. The documentation for ast_str_set and ast_str_append state that
the max_len parameter may be -1 in order to limit the size of the
ast_str to its current allocated size. The problem was that the max_len
parameter in all cases was a size_t, which is unsigned. Thus a -1 was
interpreted as UINT_MAX instead of -1. Changing the max_len parameter
to be ssize_t fixed this issue.

2. Once issue 1 was fixed, there was an off-by-one error in the case
where we attempted to write a string larger than the current allotted
size to a string when -1 was passed as the max_len parameter. When trying
to write more than the allotted size, the ast_str's __AST_STR_USED was
set to 1 higher than it should have been. Thanks to Tilghman for quickly
spotting the offending line of code.

Oh, and the unit test that I referenced in the top line of this commit
will be added to reviewboard shortly. Sit tight...



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-17 21:22:40 +00:00
..
2009-12-22 16:09:11 +00:00
2009-09-03 16:31:54 +00:00
2007-12-11 14:17:29 +00:00
2009-06-15 16:07:23 +00:00
2007-12-11 14:17:29 +00:00
2009-04-29 18:53:01 +00:00
2007-12-11 14:17:29 +00:00
2006-11-15 20:55:17 +00:00
2010-01-08 19:39:30 +00:00
2009-06-15 16:07:23 +00:00
2008-07-21 21:00:47 +00:00
2009-03-18 02:28:55 +00:00
2010-02-04 18:47:21 +00:00
2009-06-15 16:07:23 +00:00
2009-01-29 19:34:09 +00:00
2009-06-15 16:07:23 +00:00
2009-04-02 17:20:52 +00:00
2010-02-09 23:32:14 +00:00
2007-12-11 22:20:22 +00:00
2007-12-11 22:20:22 +00:00
2010-02-09 23:32:14 +00:00
2008-11-13 13:08:34 +00:00