Bug in NamedPipe::read/write on Mac/Linux


I have located a bug in reading/writing from/to pipes. We are working with an earlier version of JUCE, where the bug is in juce_mac_NamedPipe.cpp, and in the tip it’s in juce_posix_NamedPipe.cpp. In both the read() and write() functions the adjustment of the destBuffer pointer ‘p’ is being done by adding the TOTAL number of bytes read, not the CURRENT number of bytes read, resulting in the pointer traveling off into the weeds for buffer reads/writes that require more than 2 iterations.

In NamedPipe::read

should be

In NamedPipe::write

should be


Wow, thanks for spotting that! Bizarrely, it must have been in the code for years, and nobody noticed!