Github user ted-ross commented on a diff in the pull request:
https://github.com/apache/qpid-dispatch/pull/380#discussion_r219184701
--- Diff: src/iterator.c ---
@@ -768,10 +768,11 @@ char* qd_iterator_strncpy(qd_iterator_t *iter, char* buffer, int
n)
}
-uint8_t qd_iterator_uint8(qd_iterator_t *iter ) {
+// Return invalid value if iterator is empty.
+int32_t qd_iterator_uint8(qd_iterator_t *iter ) {
qd_iterator_reset(iter);
if (qd_iterator_end(iter))
- return 0;
+ return -1;
--- End diff --
I don't think this is sufficient to cover all the possible cases. This function is a
little out of place in the iterator module. The iterator is not intended to do decoding.
There are other functions in place to parse values out of iterators (see parse.h).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org
|