watch,free: interpet intervals in non-locale way
Both watch and free used the locale to determine the required delay interval for subsequent updates. It's preferable to not care about locale and accept both 12.34 and 12,34 as meaning 12 seconds and 340 microseconds. References: https://bugs.debian.org/692113 Signed-off-by: Craig Small <csmall@enc.com.au>
This commit is contained in:
4
free.c
4
free.c
@ -324,9 +324,7 @@ int main(int argc, char **argv)
|
||||
case 's':
|
||||
flags |= FREE_REPEAT;
|
||||
errno = 0;
|
||||
args.repeat_interval = (1000000 * strtof(optarg, &endptr));
|
||||
if (errno || optarg == endptr || (endptr && *endptr))
|
||||
xerrx(EXIT_FAILURE, _("seconds argument `%s' failed"), optarg);
|
||||
args.repeat_interval = (1000000 * strtod_nol_or_err(optarg, "seconds argument failed"));
|
||||
if (args.repeat_interval < 1)
|
||||
xerrx(EXIT_FAILURE,
|
||||
_("seconds argument `%s' is not positive number"), optarg);
|
||||
|
Reference in New Issue
Block a user