From: Karel Zak Date: Tue, 25 May 2021 09:32:51 +0000 (+0200) Subject: lscpu: use locale-independent strtod() when read from kernel X-Git-Tag: v2.38-rc1~486^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b538002dad7bb5e178740191961bcc69509a80d;p=thirdparty%2Futil-linux.git lscpu: use locale-independent strtod() when read from kernel Reported-by: Thomas Weißschuh Signed-off-by: Karel Zak --- 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; }