links

lynx-like text mode web browser
git clone anongit@rnpnr.xyz:links.git
Log | Files | Refs | Feed | README | LICENSE

Commit: 0dc4354c2b3e4a4926d47ae66e9de20c53f20cf7
Parent: d98051aff2f682c9b8797aaed70bdac342f2e40a
Author: 0x766F6964
Date:   Tue, 29 Oct 2019 23:02:04 -0600

remove some uneeded tests

from never equals -1 in get_translation_table_to_utf_8()
testing for q in find_host_no_cache() is unnecessary

Diffstat:
Mcharsets.c | 2--
Mdns.c | 9+--------
2 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/charsets.c b/charsets.c @@ -121,8 +121,6 @@ static struct conv_table *get_translation_table_to_utf_8(int from) { int i; static int lfr = -1; - if (from == -1) - return NULL; if (from == lfr) return utf_table; lfr = from; diff --git a/dns.c b/dns.c @@ -346,14 +346,7 @@ e: int find_host_no_cache(unsigned char *name, struct lookup_result *addr, void **qp, void (*fn)(void *, int), void *data) { struct dnsquery *q; - retry: - q = (struct dnsquery *)malloc(sizeof(struct dnsquery) + strlen(cast_const_char name)); - if (!q) { - if (out_of_memory()) - goto retry; - fn(data, 1); - return 0; - } + q = xmalloc(sizeof(struct dnsquery) + strlen(cast_const_char name)); q->fn = fn; q->data = data; q->s = (struct dnsquery **)qp;