mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 03:50:57 +01:00
fixed annoying error in _buffer_is_binary() which returned false sometimes even when the input were in fact binary. This fixes those 2 annoying unittests which failed from time to time.
This commit is contained in:
@@ -24,7 +24,9 @@
|
||||
|
||||
size_t _buffer_is_binary(unsigned char *buf, size_t len) {
|
||||
size_t pos;
|
||||
for (pos=0; pos<len; ++pos) {
|
||||
/* start at 1, to circumvent returning 0 if we find a match at position 0,
|
||||
which would lead the caller to believe the buffer is not binary */
|
||||
for (pos=1; pos<len; ++pos) {
|
||||
if(buf[pos] == '\0' || (buf[pos] != '\r' && buf[pos] != '\n' && isprint(buf[pos]) == 0)) {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user