mirror of
https://github.com/neovim/neovim.git
synced 2025-12-18 04:15:44 +00:00
strings: use (u)int16_t for %h printf format
This commit is contained in:
@@ -1001,8 +1001,8 @@ int vim_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap,
|
|||||||
switch (length_modifier) {
|
switch (length_modifier) {
|
||||||
case '\0':
|
case '\0':
|
||||||
case 'h': {
|
case 'h': {
|
||||||
// char and short arguments are passed as int
|
// char and short arguments are passed as int16_t
|
||||||
arg = (tvs ? (int)tv_nr(tvs, &arg_idx) : va_arg(ap, int));
|
arg = (int16_t)(tvs ? tv_nr(tvs, &arg_idx) : va_arg(ap, int));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'l': {
|
case 'l': {
|
||||||
@@ -1033,9 +1033,9 @@ int vim_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap,
|
|||||||
switch (length_modifier) {
|
switch (length_modifier) {
|
||||||
case '\0':
|
case '\0':
|
||||||
case 'h': {
|
case 'h': {
|
||||||
uarg = (tvs
|
uarg = (uint16_t)(tvs
|
||||||
? (unsigned)tv_nr(tvs, &arg_idx)
|
? tv_nr(tvs, &arg_idx)
|
||||||
: va_arg(ap, unsigned));
|
: va_arg(ap, unsigned));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'l': {
|
case 'l': {
|
||||||
|
|||||||
Reference in New Issue
Block a user