From eff839b26df8b10b2334e2fbdaf81fbb3236b873 Mon Sep 17 00:00:00 2001 From: Scott Prager Date: Fri, 5 Sep 2014 04:25:34 -0400 Subject: memory: xstrchrnul and xmemscan. --- src/nvim/message.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/nvim/message.c') diff --git a/src/nvim/message.c b/src/nvim/message.c index ef0faa35ee..58dbee8cf9 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -3173,8 +3173,7 @@ int vim_vsnprintf(char *str, size_t str_m, char *fmt, va_list ap, typval_T *tvs) p = ""; while (*p != NUL) { if (*p != '%') { - char *q = strchr(p + 1, '%'); - size_t n = (q == NULL) ? STRLEN(p) : (size_t)(q - p); + size_t n = xstrchrnul(p + 1, '%') - p; /* Copy up to the next '%' or NUL without any changes. */ if (str_l < str_m) { -- cgit