Re: Python formatted string bug

Guido.van.Rossum@cwi.nl
Fri, 01 Jul 1994 14:27:28 +0200

This morning, Rick Woudenberg reported a strange error in string
formatting: under very complicated rare circumstances, the result of a
formatting operation (string%tuple) may be truncated. I've tracked it
down, here's a patch.

diff -c -r2.19.2.6 stringobject.c
*** 2.19.2.6 1994/05/09 14:56:55
--- stringobject.c 1994/07/01 10:41:31
***************
*** 674,679 ****
--- 674,680 ----
if (resizestring(&result, reslen) < 0)
return NULL;
res = getstringvalue(result) + reslen - rescnt;
+ --rescnt;
}
*res++ = *fmt++;
}

--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>