Skip to content

Commit

Permalink
Allow buffer initialization to work on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
icraggs committed Dec 30, 2024
1 parent 9127790 commit 33e195a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/MQTTPacket.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,11 @@ int MQTTPacket_send_publish(Publish* pack, int dup, int qos, int retained, netwo
memcpy(pack->mask, packetbufs.mask, sizeof(pack->mask));
}
{
#if defined(_WIN32) || defined(_WIN64)
#define buflen 30
#else
const int buflen = 30;
#endif
char buf[buflen];
int len = 0;

Expand Down
4 changes: 4 additions & 0 deletions src/MQTTProtocolClient.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,11 @@ int MQTTProtocol_handlePublishes(void* pack, SOCKET sock)

/* Format and print publish data to trace */
{
#if defined(_WIN32) || defined(_WIN64)
#define buflen 30
#else
const int buflen = 30;
#endif
char buf[buflen];
int len = 0;

Expand Down

0 comments on commit 33e195a

Please sign in to comment.