Changeset 77 for trunk/samba/source/iniparser/src/iniparser.c
- Timestamp:
- Sep 30, 2007, 3:42:50 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/samba/source/iniparser/src/iniparser.c
r1 r77 5 5 @author N. Devillard 6 6 @date Mar 2000 7 @version $Revision: 2.1 4$7 @version $Revision: 2.17 $ 8 8 @brief Parser for ini files. 9 9 */ … … 11 11 12 12 /* 13 $Id: iniparser.c,v 2.1 4 2002/12/12 10:49:01ndevilla Exp $13 $Id: iniparser.c,v 2.17 2007-05-27 13:03:43 ndevilla Exp $ 14 14 $Author: ndevilla $ 15 $Date: 200 2/12/12 10:49:01$16 $Revision: 2.1 4$15 $Date: 2007-05-27 13:03:43 $ 16 $Revision: 2.17 $ 17 17 */ 18 18 … … 281 281 ini file is given as "section:key". If the key cannot be found, 282 282 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() 283 297 */ 284 298 /*--------------------------------------------------------------------------*/ … … 289 303 str = iniparser_getstring(d, key, INI_INVALID_KEY); 290 304 if (str==INI_INVALID_KEY) return notfound ; 291 return atoi(str);305 return (int)strtol(str, NULL, 0); 292 306 } 293 307
Note:
See TracChangeset
for help on using the changeset viewer.