diff options
author | Thomas Adam <thomas@xteddy.org> | 2019-05-26 21:02:26 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2019-05-26 21:02:26 +0100 |
commit | 103e44d936fef961c2117febfa0140bb220ed2be (patch) | |
tree | 2c24525b500a2c353a4137e330adbf3b15b86075 /utf8.c | |
parent | 2e84d1cf033adf8fe4b562b3d3caf390c15798a5 (diff) | |
parent | 097973e3d50c831c020fb0b689c3a2d66ba83b7c (diff) | |
download | rtmux-103e44d936fef961c2117febfa0140bb220ed2be.tar.gz rtmux-103e44d936fef961c2117febfa0140bb220ed2be.tar.bz2 rtmux-103e44d936fef961c2117febfa0140bb220ed2be.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -435,3 +435,23 @@ utf8_padcstr(const char *s, u_int width) out[slen] = '\0'; return (out); } + +int +utf8_cstrhas(const char *s, const struct utf8_data *ud) +{ + struct utf8_data *copy, *loop; + int found = 0; + + copy = utf8_fromcstr(s); + for (loop = copy; loop->size != 0; loop++) { + if (loop->size != ud->size) + continue; + if (memcmp(loop->data, ud->data, loop->size) == 0) { + found = 1; + break; + } + } + free(copy); + + return (found); +} |