About idlc/source/idlccompile.cxx

julien2412 serval2412 at yahoo.fr
Sun Jan 13 09:01:43 PST 2013


Hello,

Taking a look at this cppcheck report:
dlc/source/idlccompile.cxx
198	nullPointer	error	Possible null pointer dereference: source - otherwise
it is redundant to check it against null.

I don't understand the function "sal_Bool copyFile(const OString* source,
const OString& target)", above all this part:
    192     while ( !feof(pSource) )
    193     {
    194         if ( (readSize = fread(pBuffer, 1, totalSize, pSource)) > 0
&& !ferror(pSource) )
    195         {
    196             if ( (fwrite(pBuffer, 1, readSize, pTarget)) != readSize
|| ferror(pTarget) )
    197             {
    198                 if (source != 0) {
    199                     fclose(pSource);
    200                 }
    201                 fclose(pTarget);
    202                 return sal_False;
    203             }
    204         }
    205     }
see
http://opengrok.libreoffice.org/xref/core/idlc/source/idlccompile.cxx#173
Isn't it overcomplicated? Why reading a file 1 per 1 byte for example?

Julien



--
View this message in context: http://nabble.documentfoundation.org/About-idlc-source-idlccompile-cxx-tp4028889.html
Sent from the Dev mailing list archive at Nabble.com.


More information about the LibreOffice mailing list