bson_ascii_strtoll "base" option

XMLWordPrintableJSON

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

      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
            Reporter:
            A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: