Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1090

bson_ascii_strtoll "base" option

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.4.0
    • Affects Version/s: None
    • Component/s: json, libbson
    • Labels:

      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
      

            Assignee:
            fiona.rowan@mongodb.com Fiona Rowan
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: