From 0b538002dad7bb5e178740191961bcc69509a80d Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 25 May 2021 11:32:51 +0200 Subject: [PATCH] lscpu: use locale-independent strtod() when read from kernel MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reported-by: Thomas Weißschuh Signed-off-by: Karel Zak --- sys-utils/lscpu-cputype.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys-utils/lscpu-cputype.c b/sys-utils/lscpu-cputype.c index c2c1dc3763..023b56ee99 100644 --- a/sys-utils/lscpu-cputype.c +++ b/sys-utils/lscpu-cputype.c @@ -5,6 +5,7 @@ #include "lscpu.h" #include "fileutils.h" +#include "c_strtod.h" /* Lookup a pattern and get the value for format " : " */ @@ -512,7 +513,7 @@ int lscpu_read_cpuinfo(struct lscpu_cxt *cxt) pr->curr_type->bogomips = xstrdup(value); if (pattern->id == PAT_MHZ && pr->curr_cpu && value) { errno = 0; - pr->curr_cpu->mhz_cur_freq = strtof(value, NULL); + pr->curr_cpu->mhz_cur_freq = (float) c_strtod(value, NULL); if (errno) pr->curr_cpu->mhz_cur_freq = 0; } -- 2.47.3