Is It possible to somehow wrap this in some test case?
When just looking at this hunk the patch looks wrong. The old length correction is ok for the code above it, but then immediately after that the data pointer is updated. (At that point also the buffersize must be adjusted!)
Perhaps using a stringbuffer in this way is not really the appropriate operation?
Bert
Sent from Windows Mail
From: astieger_at_apache.org
Sent: Saturday, November 23, 2013 9:46 PM
To: commits_at_subversion.apache.org
Author: astieger
Date: Sat Nov 23 20:46:50 2013
New Revision: 1544878
URL: http://svn.apache.org/r1544878
Log:
Ensure full distribution description is printed in svn --version -v
* subversion/libsvn_subr/sysinfo.c
(stringbuf_split_key): fix buffer length calculation
Approved by: breser
Modified:
subversion/trunk/subversion/libsvn_subr/sysinfo.c
Modified: subversion/trunk/subversion/libsvn_subr/sysinfo.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/sysinfo.c?rev=1544878&r1=1544877&r2=1544878&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/sysinfo.c (original)
+++ subversion/trunk/subversion/libsvn_subr/sysinfo.c Sat Nov 23 20:46:50 2013
@@ -285,7 +285,7 @@ stringbuf_split_key(svn_stringbuf_t *buf
key = buffer->data;
end = strchr(key, delim);
*end = '\0';
- buffer->len = 1 + end - key;
+ buffer->len -= 1 + end - key;
buffer->data = end + 1;
svn_stringbuf_strip_whitespace(buffer);
Received on 2013-11-24 10:42:14 CET