Bug 58163

Summary: Missing decimal_point check in getfloat()
Product: [Retired] Red Hat Linux Reporter: Dmitry V. Levin <ldv>
Component: procpsAssignee: Alexander Larsson <alexl>
Status: CLOSED RAWHIDE QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-07-01 14:06:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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