1. 6
  1.  

    1. 1

      Except even under UNIX, one generally has to use read() returning 0 to detect EOF, not read returning less than the offered buffer size.

      Rather suggesting that the author of the code was not familiar with the origin of the function call, and so used the wrong pattern. If the correct pattern was used, then the bug would never have been seen.