timeout,top,watch,ping: parse NN.N fractional duration in locales with other separators

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2021-03-23 13:50:02 +01:00
parent 14ed4ec8a4
commit c2bd0b6806
6 changed files with 16 additions and 6 deletions

View File

@@ -122,6 +122,7 @@ static void FAST_FUNC conv_strtod(const char *arg, void *result)
char *end;
/* Well, this one allows leading whitespace... so what? */
/* What I like much less is that "-" accepted too! :( */
//TODO: needs setlocale(LC_NUMERIC, "C")?
*(double*)result = strtod(arg, &end);
if (end[0]) {
errno = ERANGE;