]> git.lyx.org Git - lyx.git/blobdiff - src/support/lyxsum.C
noncopyable + read ChangeLog
[lyx.git] / src / support / lyxsum.C
index 267413ce4229eb097537cdba0d109e6eeab57a2a..fbf532d34daadae856b2ad3995102649b28f36cd 100644 (file)
@@ -119,11 +119,14 @@ unsigned long lyx::sum(char const * file)
 #ifdef HAVE_SSTREAM
        ostringstream ostr;
        ostr << ifs.rdbuf();
-       string w = ostr.str();
+       // The .c_str() is here in case we use our lyxstring class
+       // instead of standard string. 
+       string w = ostr.str().c_str();
        return do_crc(w.begin(), w.end());
 #else
        ostrstream ostr;
        ostr << ifs.rdbuf();
+       ostr << '\0';
        char * tmp = ostr.str();
        if (!tmp) return 0; // empty file
        string w(tmp, ostr.tellp());