[asterisk-commits] mnicholson: branch 1.6.0 r238633 - in /branches/1.6.0: ./ main/file.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jan 8 13:34:08 CST 2010
Author: mnicholson
Date: Fri Jan 8 13:34:03 2010
New Revision: 238633
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=238633
Log:
Merged revisions 238630 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r238630 | mnicholson | 2010-01-08 13:32:11 -0600 (Fri, 08 Jan 2010) | 12 lines
Merged revisions 238629 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r238629 | mnicholson | 2010-01-08 13:20:44 -0600 (Fri, 08 Jan 2010) | 5 lines
Properly calculate the remaining space in the output string when reducing format strings.
(closes issue #16560)
Reported by: goldwein
........
................
Modified:
branches/1.6.0/ (props changed)
branches/1.6.0/main/file.c
Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.0/main/file.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.0/main/file.c?view=diff&rev=238633&r1=238632&r2=238633
==============================================================================
--- branches/1.6.0/main/file.c (original)
+++ branches/1.6.0/main/file.c Fri Jan 8 13:34:03 2010
@@ -1344,6 +1344,7 @@
char *orig = fmts;
int i, j, x, first, found = 0;
int len = strlen(fmts) + 1;
+ int res;
if (AST_RWLIST_RDLOCK(&formats)) {
ast_log(LOG_WARNING, "Unable to lock format list\n");
@@ -1379,8 +1380,9 @@
/* special handling for the first entry */
if (first) {
- fmts += snprintf(fmts, len, "%s", fmts_str[i]);
- len -= (fmts - orig);
+ res = snprintf(fmts, len, "%s", fmts_str[i]);
+ fmts += res;
+ len -= res;
first = 0;
continue;
}
@@ -1395,8 +1397,9 @@
}
if (!found) {
- fmts += snprintf(fmts, len, "|%s", fmts_str[i]);
- len -= (fmts - orig);
+ res = snprintf(fmts, len, "|%s", fmts_str[i]);
+ fmts += res;
+ len -= res;
}
}
More information about the asterisk-commits
mailing list