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

  • From: "jscipione" <trac@xxxxxxxxxxxx>
  • Date: Mon, 19 Sep 2011 18:31:13 -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 jscipione):

 Replying to [comment:3 bonefish]:
 > 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.

 According to [http://www.cplusplus.com/reference/clibrary/cstdlib/atoi/
 atoi()] the function returns 0 on error, and either INT_MAX or INT_MIN on
 overflow. I see that the OP ignored your strtol() suggestion in the latest
 patch. I am trying to determine whether or not that is a problem. I
 believe that atoi is okay with the caveat that if you input some crazy
 not-number string then the slider value will get set to 0.

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

Other related posts: