On Tue, Nov 28, 2006 at 11:02:27AM +0100, Georg Baum wrote:
> [EMAIL PROTECTED] wrote:
> 
> > --- lyx-devel/trunk/src/support/docstring.C (original) +++
> > lyx-devel/trunk/src/support/docstring.C Tue Nov 28 01:24:18 2006 @@ -468,6
> > +468,7 @@
> >                  s.reserve(64);
> >                  for (; iit != eit && isNumpunct(*iit); ++iit)
> >                          s += static_cast<char>(*iit);
> > +                s += '\0';
> >                  string_num_get_facet f;
> >                  f.get(s.begin(), s.end(), b, err, v);
> 
> std::string is not required to be zero-terminated (only std::string::c_str()
> is required to return a zero-terminated array of chars). That means that
> this change is wrong and may lead to "interesting" results (compare the
> recent thread about macro arguments).
> 
> The old version should be fine, the += operator should set the string length
> correctly.

You maybe right, but without the terminator I see red names, whereas
with the zero-terminator I see the symbols... Indeed, I was so sure
that it had worked without the terminator that I didn't bothered to
check it, at first.

-- 
Enrico

Reply via email to