Author Topic: Maybe src/sdk/filemanager.cpp (revision 12273)  (Read 1278 times)

Offline omlk

  • Multiple posting newcomer
  • *
  • Posts: 51
Maybe src/sdk/filemanager.cpp (revision 12273)
« on: December 27, 2020, 12:01:21 am »
+++ src/sdk/filemanager.cpp    (revision 12273)
+        if (!data && len > 0)
+            return false;
+        return file.Write(data, len) == len;
correct:
+        if (!data || len <= 0)
+            return false;
+        return file.Write(data, len) == len;

Online Commaster

  • Multiple posting newcomer
  • *
  • Posts: 110
Re: Maybe src/sdk/filemanager.cpp (revision 12273)
« Reply #1 on: December 27, 2020, 04:46:33 am »
size_t can't be < 0...

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7108
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline omlk

  • Multiple posting newcomer
  • *
  • Posts: 51
Re: Maybe src/sdk/filemanager.cpp (revision 12273)
« Reply #3 on: December 27, 2020, 06:49:30 am »
size_t can't be < 0...
I wrote safer  ;)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13239
    • Travis build status
Re: Maybe src/sdk/filemanager.cpp (revision 12273)
« Reply #4 on: December 27, 2020, 03:51:34 pm »
Fixed thanks for reporting.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]