getline.3: Note to distinguish between error and EoF
authorAaron LI <aly@aaronly.me>
Wed, 16 Jan 2019 08:51:41 +0000 (16:51 +0800)
committerAaron LI <aly@aaronly.me>
Wed, 16 Jan 2019 10:14:30 +0000 (18:14 +0800)
commit45e55a3219a7a8f2adabfdf399af71f059cfc763
treec789953a72a00b63688529a0acad5f37240d39ab
parentd883c473b2887a2c27549ef36e8a20c3e8ed71fd
getline.3: Note to distinguish between error and EoF

Note that the getline() and getdelim() functions do not distinguish
between end-of-file and error, so the callers must use feof() or
ferror() to determine which occurred.

Update the example to check the error.

Obtained-from: OpenBSD
lib/libc/stdio/getline.3