mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-09 23:00:07 +00:00
Fix small error in HP_TIMING_PRINT trailing null char setting
Fix a small error in the HP_TIMING_PRINT trailing zero setting; the '\0' should be set at MIN(Len,string length), instead of always at the 'Len' position. * sysdeps/generic/hp-timing-common.h (HP_TIMING_PRINT): Correct position of string null termination. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
parent
1a6566094d
commit
b881217f17
@ -1,3 +1,8 @@
|
||||
2019-09-17 Chung-Lin Tang <cltang@codesourcery.com>
|
||||
|
||||
* sysdeps/generic/hp-timing-common.h (HP_TIMING_PRINT): Correct
|
||||
position of string null termination.
|
||||
|
||||
2019-09-14 Aurelien Jarno <aurelien@aurel32.net>
|
||||
|
||||
[BZ #24986]
|
||||
|
@ -56,5 +56,5 @@
|
||||
char *__cp = _itoa ((Val), __buf + sizeof (__buf), 10, 0); \
|
||||
size_t __cp_len = MIN (__buf + sizeof (__buf) - __cp, __len); \
|
||||
memcpy (__dest, __cp, __cp_len); \
|
||||
__dest[__len - 1] = '\0'; \
|
||||
__dest[__cp_len - 1] = '\0'; \
|
||||
} while (0)
|
||||
|
Loading…
Reference in New Issue
Block a user