NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/48926: gethostbyname(3) doesn't appear to work under NetBSD-5.2 and NetBSD-6.1.x when hostnames appear only in /etc/hosts

On Mon, 23 Jun 2014 15:35:00 +0000 (UTC) (Christos Zoulas) wrote:
>  |  What about checking whether p[len -1] is blankish first?

Especially since comment processing can make this situation more likely.
Consider "BlahBlahBlah#oops\n"

>  And len != 0 for the paranoid.

Or do it all in one line.

while (len && isspace(p[len - 1])) p[--len] = 0

Also trims blanks at end of line.

D'Arcy J.M. Cain <> IM:darcy%Vex.Net@localhost

Home | Main Index | Thread Index | Old Index