Re: whois: remove pointless realloc()

2017-03-15 Thread Theo de Raadt
> - for (name = *argv; (name = *argv) != NULL; argv++) > - rval += whois(name, host ? host : choose_server(name, country), > - port_whois, flags); > - exit(rval); > + for (name = *argv; (name = *argv) != NULL; argv++) { > + server = host ? host :

Re: whois: remove pointless realloc()

2017-03-15 Thread Todd C. Miller
On Wed, 15 Mar 2017 09:57:26 -0600, "Todd C. Miller" wrote: > There's no need to realloc() a chunk of memory when you don't care > about the old contents, we don't want have to memcpy() the old > contents to the new chunk only to throw it away. > While here, use asprintf() to simplify things.

whois: remove pointless realloc()

2017-03-15 Thread Todd C. Miller
There's no need to realloc() a chunk of memory when you don't care about the old contents, we don't want have to memcpy() the old contents to the new chunk only to throw it away. While here, use asprintf() to simplify things. - todd Index: usr.bin/whois/whois.c