Uploaded image for project: 'Couchbase C client library libcouchbase'
  1. Couchbase C client library libcouchbase
  2. CCBC-1539

Make response value string null terminated suggestion

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Incomplete
    • Minor
    • tombstone
    • None
    • library
    • None
    • 1

    Description

      lcb_respget_value function sets a pair of const char* string data and size_t length, hence I understand there is no guarantees that string data is null terminated (and I have verified it's not). However at cost of adding 1 null char to data received from server (If I am not mistaken value is last data in response), we could have flexibility to use null byte as sentinel for JSON parsing, avoiding many checks for remainining length.

      Of course as with std::string length would still not include final null char, and client still free to use length if their want to.

      Do you think it is something it's feasible to add please ?

      Thanks a lot

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            avsej Sergey Avseyev
            jo JC
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty