Skip to content
Snippets Groups Projects
Commit f5fabdbd authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Try an anonymous union containing an anonymouse struct to fix it.

parent 875342b1
No related branches found
No related tags found
No related merge requests found
Pipeline #5684 failed
......@@ -64,8 +64,13 @@
typedef struct sftp_tx_pkt {
uint32_t sz;
uint32_t used;
union {
struct {
uint8_t type;
uint8_t data[];
};
uint8_t tdata[];
}
} *sftp_tx_pkt_t;
typedef struct sftp_rx_pkt {
......
......@@ -287,7 +287,7 @@ sftp_tx_pkt_reset(sftp_tx_pkt_t *pktp)
if (!grow_tx(pktp, sizeof(var))) \
return false; \
sftp_tx_pkt_t pkt = *pktp; \
memcpy((uint64_t *)(&(&pkt->type)[pkt->used]), &var, sizeof(var)); \
memcpy(&pkt->tdata[pkt->used], &var, sizeof(var)); \
pkt->used += sizeof(var); \
return true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment