strings: Remove vim_strbyte

Ref #1476
This commit is contained in:
ZyX
2017-04-06 21:31:37 +03:00
parent 19044a15f9
commit 171baaee93
6 changed files with 29 additions and 67 deletions

View File

@@ -356,10 +356,10 @@ int bomb_size(void)
*/
void remove_bom(char_u *s)
{
char_u *p = s;
char *p = (char *)s;
while ((p = vim_strbyte(p, 0xef)) != NULL) {
if (p[1] == 0xbb && p[2] == 0xbf) {
while ((p = strchr(p, 0xef)) != NULL) {
if ((uint8_t)p[1] == 0xbb && (uint8_t)p[2] == 0xbf) {
STRMOVE(p, p + 3);
} else {
p++;