You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2021/05/17 20:13:52 UTC

[GitHub] [qpid-dispatch] jiridanek commented on a change in pull request #1219: DISPATCH-2068: Check endinaness before copying bytes into array

jiridanek commented on a change in pull request #1219:
URL: https://github.com/apache/qpid-dispatch/pull/1219#discussion_r633835842



##########
File path: src/message.c
##########
@@ -220,11 +229,17 @@ static void print_parsed_field(qd_parsed_field_t *parsed_field, char **begin, ch
            // 64-bit two’s-complement integer representing milliseconds since the unix epoch
            int timestamp_length = 8;
            pn_timestamp_t creation_timestamp = 0;
-
-           //qd_iterator_t* iter = qd_message_field_iterator(msg, field);
            qd_iterator_t *iter = qd_parse_raw(parsed_field);
-           while (!qd_iterator_end(iter) && timestamp_length > 0) {
-               timestamp_bytes[--timestamp_length] = qd_iterator_octet(iter);
+           if (lil_endian()) {

Review comment:
       I'm trying to see if advice from https://commandcenter.blogspot.com/2012/04/byte-order-fallacy.html?m=1 is applicable. So far, I think yes. The code given there does not have to ask about the native byteorder, only about the byteorder used by the network protocol.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org