Skip to content
Snippets Groups Projects
Commit 396c774e authored by Walter Lozano's avatar Walter Lozano
Browse files

Fix error handling with getline

The function getline is used to read data from different streams, however,
the error handling is not accurate.

From the man page, getline returns -1 on failure and sets errno accordingly,
but the current implementation only checks errno to see if there was a
failure. With this approach, in case getline returns success but also sets
errno it is consider and error.

Fix the issue but also checking the return value of getline.

Forwarded: https://salsa.debian.org/apt-team/apt/-/merge_requests/265



Signed-off-by: default avatarWalter Lozano <walter.lozano@collabora.com>
parent 183d01c2
No related branches found
No related tags found
Loading
Checking pipeline status
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment