fixup: use vim_snprintf, ASCII_ISALNUM

ASCII_ISALNUM is part of vim-patch:8.1.0540
This commit is contained in:
Abdelhakeem 2019-03-28 02:00:34 +02:00 committed by Justin M. Keyes
parent b22ca804dd
commit 842e6fb92f

View File

@ -1949,8 +1949,8 @@ static char_u *illegal_char(char_u *errbuf, size_t errbuflen, int c)
if (errbuf == NULL) { if (errbuf == NULL) {
return (char_u *)""; return (char_u *)"";
} }
snprintf((char *)errbuf, errbuflen, _("E539: Illegal character <%s>"), vim_snprintf((char *)errbuf, errbuflen, _("E539: Illegal character <%s>"),
(char *)transchar(c)); (char *)transchar(c));
return errbuf; return errbuf;
} }
@ -2881,9 +2881,9 @@ ambw_end:
if (!ascii_isdigit(*(s - 1))) { if (!ascii_isdigit(*(s - 1))) {
if (errbuf != NULL) { if (errbuf != NULL) {
snprintf((char *)errbuf, errbuflen, vim_snprintf((char *)errbuf, errbuflen,
_("E526: Missing number after <%s>"), _("E526: Missing number after <%s>"),
transchar_byte(*(s - 1))); transchar_byte(*(s - 1)));
errmsg = errbuf; errmsg = errbuf;
} else } else
errmsg = (char_u *)""; errmsg = (char_u *)"";
@ -3059,9 +3059,9 @@ ambw_end:
} }
} else { } else {
if (errbuf != NULL) { if (errbuf != NULL) {
snprintf((char *)errbuf, errbuflen, vim_snprintf((char *)errbuf, errbuflen,
_("E535: Illegal character after <%c>"), _("E535: Illegal character after <%c>"),
*--s); *--s);
errmsg = errbuf; errmsg = errbuf;
} else } else
errmsg = (char_u *)""; errmsg = (char_u *)"";
@ -3354,7 +3354,7 @@ ambw_end:
* '.encoding'. * '.encoding'.
*/ */
for (p = q; *p != NUL; p++) { for (p = q; *p != NUL; p++) {
if (!ASCII_ISALPHA(*p) && *p != '-') { if (!ASCII_ISALNUM(*p) && *p != '-') {
break; break;
} }
} }