Ignore:
Timestamp:
Sep 30, 2007, 3:42:50 AM (18 years ago)
Author:
Paul Smedley
Message:

Update trunk to 3.2.0pre1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/samba/source/iniparser/src/iniparser.c

    r1 r77  
    55   @author  N. Devillard
    66   @date    Mar 2000
    7    @version $Revision: 2.14 $
     7   @version $Revision: 2.17 $
    88   @brief   Parser for ini files.
    99*/
     
    1111
    1212/*
    13     $Id: iniparser.c,v 2.14 2002/12/12 10:49:01 ndevilla Exp $
     13    $Id: iniparser.c,v 2.17 2007-05-27 13:03:43 ndevilla Exp $
    1414    $Author: ndevilla $
    15     $Date: 2002/12/12 10:49:01 $
    16     $Revision: 2.14 $
     15    $Date: 2007-05-27 13:03:43 $
     16    $Revision: 2.17 $
    1717*/
    1818
     
    281281  ini file is given as "section:key". If the key cannot be found,
    282282  the notfound value is returned.
     283
     284  Supported values for integers include the usual C notation
     285  so decimal, octal (starting with 0) and hexadecimal (starting with 0x)
     286  are supported. Examples:
     287
     288  "42"      ->  42
     289  "042"     ->  34 (octal -> decimal)
     290  "0x42"    ->  66 (hexa  -> decimal)
     291
     292  Warning: the conversion may overflow in various ways. Conversion is
     293  totally outsourced to strtol(), see the associated man page for overflow
     294  handling.
     295
     296  Credits: Thanks to A. Becker for suggesting strtol()
    283297 */
    284298/*--------------------------------------------------------------------------*/
     
    289303    str = iniparser_getstring(d, key, INI_INVALID_KEY);
    290304    if (str==INI_INVALID_KEY) return notfound ;
    291     return atoi(str);
     305    return (int)strtol(str, NULL, 0);
    292306}
    293307
Note: See TracChangeset for help on using the changeset viewer.