Always print leading zeros in mosquitto_sub when output format is hex.
Closes #1066. Thanks to skiizo. Bug: https://github.com/eclipse/mosquitto/issues/1066
This commit is contained in:
parent
9464e3fe19
commit
34293d07c1
@ -1,3 +1,11 @@
|
|||||||
|
1.5.5 - 201812xx
|
||||||
|
================
|
||||||
|
|
||||||
|
Client:
|
||||||
|
- Always print leading zeros in mosquitto_sub when output format is hex.
|
||||||
|
Closes #1066.
|
||||||
|
|
||||||
|
|
||||||
1.5.4 - 20181108
|
1.5.4 - 20181108
|
||||||
================
|
================
|
||||||
|
|
||||||
|
@ -85,11 +85,11 @@ static void write_payload(const unsigned char *payload, int payloadlen, int hex)
|
|||||||
(void)fwrite(payload, 1, payloadlen, stdout);
|
(void)fwrite(payload, 1, payloadlen, stdout);
|
||||||
}else if(hex == 1){
|
}else if(hex == 1){
|
||||||
for(i=0; i<payloadlen; i++){
|
for(i=0; i<payloadlen; i++){
|
||||||
fprintf(stdout, "%x", payload[i]);
|
fprintf(stdout, "%02x", payload[i]);
|
||||||
}
|
}
|
||||||
}else if(hex == 2){
|
}else if(hex == 2){
|
||||||
for(i=0; i<payloadlen; i++){
|
for(i=0; i<payloadlen; i++){
|
||||||
fprintf(stdout, "%X", payload[i]);
|
fprintf(stdout, "%02X", payload[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user