[haiku-bugs] Re: [Haiku] #7991: [DriveSetup] Add Text Control, in addition to size slider, to partition creation dialog

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Sat, 17 Sep 2011 16:45:04 -0000

#7991: [DriveSetup] Add Text Control, in addition to size slider, to partition
creation dialog
---------------------------------------+----------------------------
   Reporter:  jwlh172                  |      Owner:  stippi
       Type:  enhancement              |     Status:  new
   Priority:  normal                   |  Milestone:  R1
  Component:  Applications/DriveSetup  |    Version:  R1/Development
 Resolution:                           |   Keywords:
 Blocked By:                           |   Blocking:
Has a Patch:  1                        |   Platform:  All
---------------------------------------+----------------------------

Comment (by bonefish):

 Replying to [comment:2 stippi]:
 >  * While the above two items are cosmetical, the next one is a real
 issue: The text control allows for arbitrary input by the user. The atoi()
 function may not be able to do anything with the string. So first of all,
 you should check the return value from the atoi() method. If it's invalid,
 or falls out of range, you should reject the input and reset the text
 field's contents.

 There's
 [http://pubs.opengroup.org/onlinepubs/9699919799/functions/strtol.html
 strtol()] which allows to check whether parsing the string actually worked
 (and to which character). `atoi()`'s return value in case of error is
 actually undefined.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/7991#comment:3>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: