Angus Leeming <[EMAIL PROTECTED]> writes: | On Thursday 02 May 2002 6:03 pm, Herbert Voss wrote: >> Angus Leeming wrote: >> > On Thursday 02 May 2002 5:17 pm, Herbert Voss wrote: >> >>I don't who committed this: >> >> >> >>2002-05-02 Herbert Voss <[EMAIL PROTECTED]> >> >> >> >> * filetools.C: getline -> std::getline. >> >> >> >> >> >>maybe that I'm getting old, but this is in my ChangeLog, but >> >>not changed in my filetools.C and I never send such patch. >> > >> > I too am getting old. I've applied so many of your patches recently that >> > my subconscious must have thought I'd changed my name. >> > >> > I'll change the ChangeLog entry to blame myself, but you should find a >> > using::std::getline directive on line 70 of filetools.C. >> >> ok, I misunderstand the changelog; looked for the one in the function. >> Could you please apply the patch with the changed lyxerr line, >> which nobody hurts. it's annoying when I'm fixing bugs and get >> that output. >> >> Herbert > | I don't think it's safe. What if str has zero length? You need > | string const print_str = (str.size() > 60) ? str.substr(0,60) : str; | lyxerr[Debug::GRAPHICS] << "Scanstring: " << print_str << endl; > | To the C++-experts out there: > | Am I right? Is str.substr(0,60) unsafe if str has zero size?
I think you are wrong. But easy to check... just try it. I think that str.substr(0) == str str.substr(0, <number larger than leght of str>) == str easy to check though. -- Lgb