[CDRIVER-1090] bson_ascii_strtoll "base" option Created: 09/Feb/16  Updated: 07/Jun/16  Resolved: 07/Jun/16

Status: Closed
Project: C Driver
Component/s: json, libbson
Affects Version/s: None
Fix Version/s: 1.4.0

Type: Bug Priority: Minor - P4
Reporter: A. Jesse Jiryu Davis Assignee: Fiona Rowan
Resolution: Done Votes: 0
Labels: intern2016
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

A base of "0" means "auto-detect" in standard strtoll, but doesn't work with bson_ascii_strtoll:

strtoll ("010", &endptr, 0); -> 8
strtoll ("010", &endptr, 0); -> 0, errno is EINVAL

Explicitly setting the base to 10 doesn't override octal number parsing properly:

strtoll ("08", &endptr, 10); -> 8
bson_ascii_strtoll ("08", &endptr, 10); -> 0, errno is EINVAL



 Comments   
Comment by Githook User [ 07/Jun/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@emptysquare.net'}

Message: Merge pull request #159 from fionaRowan/CDRIVER-1090

CDRIVER-1090 fix bson_ascii_strtoll when base = 0
Branch: master
https://github.com/mongodb/libbson/commit/08fa430dff0de02f87d51418f52e40eef2ae0ab3

Comment by Githook User [ 07/Jun/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@emptysquare.net'}

Message: Merge pull request #159 from fionaRowan/CDRIVER-1090

CDRIVER-1090 fix bson_ascii_strtoll when base = 0
Branch: master
https://github.com/mongodb/libbson/commit/08fa430dff0de02f87d51418f52e40eef2ae0ab3

Comment by Githook User [ 07/Jun/16 ]

Author:

{u'name': u'Fiona Rowan', u'email': u'fionarowan@MacBook-Pro-93.local'}

Message: CDRIVER-1090 fix bson_ascii_strtoll when base = 0
Branch: master
https://github.com/mongodb/libbson/commit/be277fc04d5ddaa681a1ecc14e2026b6ea642805

Generated at Wed Feb 07 21:11:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.