diff options
Diffstat (limited to 'sql-common/my_time.c')
-rw-r--r-- | sql-common/my_time.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/sql-common/my_time.c b/sql-common/my_time.c index ac6c2ace890..0a09e945022 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -1024,21 +1024,30 @@ void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type) int my_time_to_str(const MYSQL_TIME *l_time, char *to) { uint extra_hours= 0; - return sprintf(to, "%s%02u:%02u:%02u", (l_time->neg ? "-" : ""), - extra_hours+ l_time->hour, l_time->minute, l_time->second); + return my_sprintf(to, (to, "%s%02u:%02u:%02u", + (l_time->neg ? "-" : ""), + extra_hours+ l_time->hour, + l_time->minute, + l_time->second)); } int my_date_to_str(const MYSQL_TIME *l_time, char *to) { - return sprintf(to, "%04u-%02u-%02u", - l_time->year, l_time->month, l_time->day); + return my_sprintf(to, (to, "%04u-%02u-%02u", + l_time->year, + l_time->month, + l_time->day)); } int my_datetime_to_str(const MYSQL_TIME *l_time, char *to) { - return sprintf(to, "%04u-%02u-%02u %02u:%02u:%02u", - l_time->year, l_time->month, l_time->day, - l_time->hour, l_time->minute, l_time->second); + return my_sprintf(to, (to, "%04u-%02u-%02u %02u:%02u:%02u", + l_time->year, + l_time->month, + l_time->day, + l_time->hour, + l_time->minute, + l_time->second)); } |