--------------------- PatchSet 10195 Date: 2007/12/06 06:25:37 Author: adri Branch: s27_adri Tag: (none) Log: strSet() shoudl take an offset and not a pointer. Members: libbuf/String.h:1.1.2.3->1.1.2.4 Index: squid/libbuf/String.h =================================================================== RCS file: /cvsroot/squid-sf//squid/libbuf/Attic/String.h,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- squid/libbuf/String.h 5 Dec 2007 05:35:29 -0000 1.1.2.3 +++ squid/libbuf/String.h 6 Dec 2007 06:25:37 -0000 1.1.2.4 @@ -57,12 +57,14 @@ /* These following functions will trigger a copy on write! */ /* XXX these functions which take a char pointer need to be rewritten to take a pos first! */ -static inline void strSet(String s, const char *ptr, char ch) +static inline void strSet(String s, int offset, char ch) { int a; + assert(offset < s.len); + stringMakePrivate(&s); - a = buf_put_chr(s.nb, ptr - buf_buf(s.nb), ch); + a = buf_put_chr(s.nb, offset, ch); assert(a); }