Bug 58163 - Missing decimal_point check in getfloat()
Summary: Missing decimal_point check in getfloat()
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: procps
Version: 7.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Alexander Larsson
QA Contact: Aaron Brown
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-01-10 13:11 UTC by Dmitry V. Levin
Modified: 2007-04-18 16:38 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 2002-07-01 14:06:59 UTC


Attachments (Terms of Use)

Description Dmitry V. Levin 2002-01-10 13:11:12 UTC
Description of Problem:
For locales where nl_langinfo(DECIMAL_POINT) != ".",
top program doesn't accept float update intervals.

Version-Release number of selected component (if applicable):
procps >= 2.0.7 (all redhat releases with Jakub's patch).

How Reproducible:
Always for locales described above.

Steps to Reproduce:
1. run top
2. type s
3. type 0,5

Actual Results:
That's not a float!
 
Expected Results:
Set update interval to half of second.

Additional Information:

Fix is trivial:
--- procps-2.0.7~/top.c
+++ procps-2.0.7/top.c
@@ -707,7 +707,7 @@
     line = getstr();
 
     for (i = 0; line[i]; i++) {
-
if (!isdigit(line[i]) && line[i] != '.' && line[i] != '-') {
+
if (!isdigit(line[i]) && line[i] != decimal_point[0] && line[i] != '-') {
 	    SHOWMESSAGE(("That's not a float!"));
 	    return (BAD_INPUT);
 }

Comment 1 Alexander Larsson 2002-08-08 14:21:30 UTC
Should be fixed in 2.0.7-24


Note You need to log in before you can comment on or make changes to this bug.