mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Made my_snprintf() behavior snprintf() compatible when printing %x arguments (it should
produce hex digits in lower case). (fixed version) Replaced _dig_vec array with two _dig_vec_upper/_dig_vec_lower arrays. Added extra argument to int2str function which controls case of digits you get. Replaced lot of invocations of int2str for decimal radix with more optimized int10_to_str() function. Removed unused my_itoa/my_ltoa functions.
This commit is contained in:
@ -118,7 +118,7 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
|
||||
if (*fmt== 'u')
|
||||
store_end= int10_to_str(larg, store_start, 10);
|
||||
else
|
||||
store_end= int2str(larg, store_start, 16);
|
||||
store_end= int2str(larg, store_start, 16, 0);
|
||||
if ((res_length= (uint) (store_end - store_start)) > to_length)
|
||||
break; /* num doesn't fit in output */
|
||||
/* If %#d syntax was used, we have to pre-zero/pre-space the string */
|
||||
|
Reference in New Issue
Block a user