vim-patch:9.2.0233: Compiler warning in strings.c (#38450)

Problem:  Compiler warning in strings.c
          (Timothy Rice, after v9.2.0031)
Solution: Return early when str_m is zero
          (Hirohito Higashi)

fixes:  vim/vim#19795
closes: vim/vim#19800

347e8c1e7d

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
This commit is contained in:
zeertzjq
2026-03-24 07:16:29 +08:00
committed by GitHub
parent f29b3b5d45
commit 416e542992

View File

@@ -805,6 +805,10 @@ size_t vim_snprintf_safelen(char *str, size_t str_m, const char *fmt, ...)
va_list ap;
int str_l;
if (str_m == 0) {
return 0;
}
va_start(ap, fmt);
str_l = vim_vsnprintf_typval(str, str_m, fmt, ap, NULL);
va_end(ap);