From: <laz...@us...> - 2004-02-28 22:45:07
|
Update of /cvsroot/rtk/rtk/src/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15328/src/core Modified Files: rchar.cpp Log Message: really minor change :) Pali: No I didn't test it :)) Sooorry about that!!! but allocating in heap is not necessary in that case, (atleast embed sys) allocating in stack is more robust than in heap. Copying buffer while looping is normally same as strdup does, so this way we eliminate strdup loop completely. Index: rchar.cpp =================================================================== RCS file: /cvsroot/rtk/rtk/src/core/rchar.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** rchar.cpp 28 Feb 2004 20:59:24 -0000 1.4 --- rchar.cpp 28 Feb 2004 22:27:26 -0000 1.5 *************** *** 48,51 **** --- 48,56 ---- [...] IMHO smaller and faster + + Mikko: + s_ptr[1] can be over the actual buffer, if last char in fmt is '%' + So this is incorrect. + */ #define CVT(fmt_len) \ *************** *** 64,68 **** } \ } \ ! *d_ptr = 0; \ fmt = fmt2 --- 69,73 ---- } \ } \ ! *d_ptr = '\0'; \ fmt = fmt2 |