diff options
Diffstat (limited to 'apt-pkg')
| -rw-r--r-- | apt-pkg/contrib/fileutl.cc | 2 | ||||
| -rw-r--r-- | apt-pkg/contrib/gpgv.cc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 4dd7b1ac3..85997275c 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -1003,7 +1003,7 @@ bool StartsWithGPGClearTextSignature(string const &FileName) errno = 0; DEFER([&] { fclose(gpg); free(lineptr); }); ssize_t const result = getline(&lineptr, &n, gpg); - if (errno != 0) + if (result < 0 && errno != 0) { _error->Errno("getline", "Could not read from %s", FileName.c_str()); return false; diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc index b555331d6..0341521ac 100644 --- a/apt-pkg/contrib/gpgv.cc +++ b/apt-pkg/contrib/gpgv.cc @@ -76,7 +76,7 @@ class LineBuffer /*{{{*/ { errno = 0; line_length = getline(&buffer, &buffer_size, stream); - if (errno != 0) + if (line_length < 0 && errno != 0) return _error->Errno("getline", "Could not read from %s", InFile.c_str()); if (line_length == -1) { |
