Re: small problem in lyxstring constructor

2000-09-25 Thread Jean-Marc Lasgouttes
"Lars" == Lars Gullik Bjønnes [EMAIL PROTECTED] writes: Lars But we should check the standard, and see if a '\0' teminated Lars string is required, and wat values of n is allowed. You are right. The standard says nothing about the string being 0-terminated (or using traits to get the length)

Re: small problem in lyxstring constructor

2000-09-25 Thread Jean-Marc Lasgouttes
> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: Lars> But we should check the standard, and see if a '\0' teminated Lars> string is required, and wat values of n is allowed. You are right. The standard says nothing about the string being 0-terminated (or using traits to get the

Re: small problem in lyxstring constructor

2000-09-23 Thread Andre Poenitz
I have anoter proposal: Since there is a n argument, we can expect this to be meeningful, so: I think so, too. lyxstring::lyxstring(value_type const * s, size_type n) { Assert(s n npos); // STD! static Srep empty_rep(0, ""); if (*s n) { // s is not empty string and

Re: small problem in lyxstring constructor

2000-09-23 Thread Andre Poenitz
> I have anoter proposal: Since there is a n argument, we can expect > this to be meeningful, so: I think so, too. > lyxstring::lyxstring(value_type const * s, size_type n) > { > Assert(s && n < npos); // STD! > static Srep empty_rep(0, ""); > if (*s && n) { // s is not empty

Re: small problem in lyxstring constructor

2000-09-22 Thread Lars Gullik Bjønnes
Jean-Marc Lasgouttes [EMAIL PROTECTED] writes: | While running purify on lyx, I find plenty of uninitialized memory | read coming from lyxstring constructor | lyxstring::lyxstring(value_type const * s, size_type n) | | The problem is that the constructor uses at some place min(n, strlen(s))

Re: small problem in lyxstring constructor

2000-09-22 Thread Lars Gullik Bjønnes
Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: | While running purify on lyx, I find plenty of uninitialized memory | read coming from lyxstring constructor | lyxstring::lyxstring(value_type const * s, size_type n) | | The problem is that the constructor uses at some place min(n, strlen(s))

small problem in lyxstring constructor

2000-09-21 Thread Jean-Marc Lasgouttes
While running purify on lyx, I find plenty of uninitialized memory read coming from lyxstring constructor lyxstring::lyxstring(value_type const * s, size_type n) The problem is that the constructor uses at some place min(n, strlen(s)) although s may not be null terminated. I propose to

small problem in lyxstring constructor

2000-09-21 Thread Jean-Marc Lasgouttes
While running purify on lyx, I find plenty of uninitialized memory read coming from lyxstring constructor lyxstring::lyxstring(value_type const * s, size_type n) The problem is that the constructor uses at some place min(n, strlen(s)) although s may not be null terminated. I propose to