fix regression in cae4336

Change-Id: I026fe919401bbe13cef161a6eb6ce44e5fbbbb6f
This commit is contained in:
Christian Soffke 2026-05-17 14:45:57 +02:00
parent cae433608f
commit 8abc859c32

View file

@ -1432,8 +1432,9 @@ const char *format_time_auto(char *buffer, int buf_len, long value,
#if 0 /* unused */ #if 0 /* unused */
left_offset = -(offsets[max_idx]); left_offset = -(offsets[max_idx]);
left_offset += strlcpy(buffer, sign, buf_len); left_offset +=
#endif #endif
strlcpy(buffer, sign, buf_len);
/* trim leading zero on the max_idx */ /* trim leading zero on the max_idx */
if ((unit_idx & UNIT_TRIM_ZERO) == UNIT_TRIM_ZERO && if ((unit_idx & UNIT_TRIM_ZERO) == UNIT_TRIM_ZERO &&
@ -1479,8 +1480,9 @@ const char *format_time_auto(char *buffer, int buf_len, long value,
{ {
strmemccpy(buffer, unit_strings_core[units[max_idx]], buf_len); strmemccpy(buffer, unit_strings_core[units[max_idx]], buf_len);
#if 0 /* unused */ #if 0 /* unused */
left_offset += strlcat(buffer, " ", buf_len); left_offset +=
#endif #endif
strlcat(buffer, " ", buf_len);
strlcat(buffer, &timebuf[offsets[base_idx]], buf_len); strlcat(buffer, &timebuf[offsets[base_idx]], buf_len);
} }
else else