ether_ntohost(3) and ether_hostton(3) can't treat the line without newline in ethers(5).

Issue #92 closed
Takehiko NOZAKI repo owner created an issue

fgetln(3) usage seems wrong in src/lib/libc/net/ethers.c such as:

       while ((p = fgetln(f, &len)) != NULL) {
               if (p[len - 1] != '\n')
                       continue;               /* skip lines w/o \n */
               p[--len] = '\0';

if last line doesn't end with newline, it will be ignored.

Comments (4)

  1. Takehiko NOZAKI reporter

    fgetln(3) is troublesome and now we have getline(3) in POSIX:2008, use it instead.

  2. Log in to comment