D23159: Prevent error() being emitted when purposefully reading 0 bytes

Chinmoy Ranjan Pradhan noreply at phabricator.kde.org
Thu Aug 15 19:13:45 BST 2019


chinmoyr added inline comments.

INLINE COMMENTS

> file.cpp:524
>      while (true) {
>          QByteArray res = mFile->read(bytes);
>  

This doesn't support error reporting. Why not refactor this loop using read(char *, qint64)? I believe you can accommodate your changes inside the loop cleanly then.

> file.cpp:538
>          }
>          if (bytes <= 0) {
>              break;

here `bytes` being negative should be an error..no?

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D23159

To: feverfew, dfaure, fvogt, chinmoyr
Cc: apol, kfm-devel, kde-frameworks-devel, LeGast00n, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20190815/d854870d/attachment.htm>


More information about the kfm-devel mailing list