From b94acada9ed0e11a7e82f8f60280c5b6058e4250 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Thu, 16 May 2019 11:44:38 +0100 Subject: lscpu: move trailing null after removing characters from a string From the test input string ':' characters are removed: cat x86_64-epyc_7451/sys/devices/system/cpu/vulnerabilities/spectre_v2 Mitigation: Full AMD retpoline, IBPB: conditional, STIBP: disabled, RSB filling Signed-off-by: Sami Kerola --- include/strutils.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/strutils.h') diff --git a/include/strutils.h b/include/strutils.h index 5584ac5ec..50733c5f5 100644 --- a/include/strutils.h +++ b/include/strutils.h @@ -262,6 +262,7 @@ static inline void strrem(char *s, int rem) if (*s != rem) *p++ = *s; } + *p = '\0'; } extern char *strnappend(const char *s, const char *suffix, size_t b); -- cgit v1.2.3-55-g7522