The bug turns out to have been introduced in 2003, with change 18580.
p4raw-id: //depot/perl@34371
#endif
if (bytesread < 0)
bytesread = 0;
- SvCUR_set(sv, bytesread += append);
+ SvCUR_set(sv, bytesread + append);
buffer[bytesread] = '\0';
goto return_string_or_null;
}