"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
Re: gotwebd: merge host() and get_addrs(); use * instead of ""
To:
Stefan Sperling <stsp@stsp.name>
Cc:
gameoftrees@openbsd.org
Date:
Wed, 15 Nov 2023 13:55:35 +0100

Download raw body.

Thread
On 2023/11/15 13:46:56 +0100, Stefan Sperling <stsp@stsp.name> wrote:
> On Wed, Nov 15, 2023 at 10:25:52AM +0100, Omar Polo wrote:
> > +	n = snprintf(portstr, sizeof(portstr), "%d", port);
> > +	if (n < 0 || (size_t)n >= sizeof(portstr))
> > +		fatalx("snprintf: number too long");
> 
> This error message could provide more context to be helpful:
> 
> 		fatalx("snprintf: port number too long: %d", port);

I haven't payed much attention to the error message in this case since I
don't believe snprintf can fail here, but sure, changed the error message.

> [...]
> > +		} else {
> > +			if (strlcpy(h->ifname, s, sizeof(h->ifname)) >=
> >  			    sizeof(h->ifname)) {
> >  				log_warnx("%s: interface name truncated",
> 
> Change 'interface name' to 'address' in this warning?

wooops, I should have changed this in the previous commit actually.
thanks for spotting!