Skip to content

Commit

Permalink
Fix mosquitto_sub %j or %J not working on Windows.
Browse files Browse the repository at this point in the history
Closes eclipse#1674. Thanks to amigian74.
  • Loading branch information
ralight authored and FranciscoKnebel committed Jul 30, 2020
1 parent 60a9ac3 commit 5c3af7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog.txt
Expand Up @@ -12,6 +12,9 @@ Client library:
- Don't treat an unexpected PUBACK, PUBREL, or PUBCOMP as a fatal error.
Issue #1629.

Clients:
- Fix mosquitto_sub %j or %J not working on Windows. Closes #1674.

Build:
- Various fixes for building with <C99 support. Closes #1622.
- Fix use of sed on BSD. Closes #1614.
Expand Down
2 changes: 1 addition & 1 deletion client/sub_client_output.c
Expand Up @@ -114,7 +114,7 @@ static void json_print(const struct mosquitto_message *message, const struct tm
{
char buf[100];

strftime(buf, 100, "%s", ti);
snprintf(buf, 100, "%ld", time(NULL));
printf("{\"tst\":%s,\"topic\":\"%s\",\"qos\":%d,\"retain\":%d,\"payloadlen\":%d,", buf, message->topic, message->qos, message->retain, message->payloadlen);
if(message->qos > 0){
printf("\"mid\":%d,", message->mid);
Expand Down

0 comments on commit 5c3af7a

Please sign in to comment.