links

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

Commit: f1a6025a0f12383fb550de8245f00a3bf5fd7138
Parent: a620ded19d77ca6038941376da215639f0d4465d
Author: opask
Date:   Tue,  4 Dec 2018 15:58:13 -0700

charsets.c: remove xxstrcmp()

Diffstat:
Mcharsets.c | 16+---------------
1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/charsets.c b/charsets.c @@ -233,20 +233,6 @@ struct conv_table *get_translation_table(const int from, const int to) return get_translation_table_to_utf_8(from); } -static inline int xxstrcmp(unsigned char *s1, unsigned char *s2, int l2) -{ - while (l2) { - if (*s1 > *s2) - return 1; - if (!*s1 || *s1 < *s2) - return -1; - s1++; - s2++; - l2--; - } - return !!*s1; -} - int get_entity_number(unsigned char *st, int l) { int n = 0; @@ -297,7 +283,7 @@ unsigned char *get_entity_string(unsigned char *st, int l, int encoding) while (s <= e) { int c; int m = (s + e) / 2; - c = xxstrcmp(cast_uchar entities[m].s, st, l); + c = strncmp(entities[m].s, (char *)st, l); if (!c) { n = entities[m].c; goto f;