stas 2004/05/12 18:33:52
Modified: src/modules/perl modperl_util.h Log: explain why we always copy the string Revision Changes Path 1.60 +7 -2 modperl-2.0/src/modules/perl/modperl_util.h Index: modperl_util.h =================================================================== RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v retrieving revision 1.59 retrieving revision 1.60 diff -u -u -r1.59 -r1.60 --- modperl_util.h 13 May 2004 01:28:39 -0000 1.59 +++ modperl_util.h 13 May 2004 01:33:52 -0000 1.60 @@ -215,8 +215,13 @@ #endif /* USE_ITHREADS */ /* dumping hundreds of lines in the trace, makes it less useful. Get a - * string chunk of MP_TRACE_STR_LEN or less. Not too long so it won't - * wrap when posted in email */ + * string chunk of MP_TRACE_STR_LEN bytes or less. Not too long so it + * won't wrap when posted in email. Notice that we copy 'count' bytes + * of the string even if count < MP_TRACE_STR_LEN, because the 'str' + * buffer doesn't necessarily have \0 terminator at 'count'. As this + * is for debug tracing, not to be used in production, it doesn't make + * any difference if it's not efficient. + */ #define MP_TRACE_STR_LEN 35 #define MP_TRACE_STR_TRUNC(p, str, count) \ count < MP_TRACE_STR_LEN \