Skip to content

Commit

Permalink
Fix builds on Windows
Browse files Browse the repository at this point in the history
Quick fix with latest Windows image on GitHub CI, where we got:
```
 ndpiReader.c:2860:38: error: '%s' directive output may be truncated writing up to 64 bytes into a region of size 63 [-Werror=format-truncation=]
 2860 |     snprintf(srcip, sizeof(srcip), "[%s]", flow->src_name);
      |                                      ^~
ndpiReader.c:2860:5: note: 'snprintf' output between 3 and 67 bytes into a destination of size 64
 2860 |     snprintf(srcip, sizeof(srcip), "[%s]", flow->src_name);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ndpiReader.c:2861:38: error: '%s' directive output may be truncated writing up to 64 bytes into a region of size 63 [-Werror=format-truncation=]
 2861 |     snprintf(dstip, sizeof(dstip), "[%s]", flow->dst_name);
      |                                      ^~
ndpiReader.c:2861:5: note: 'snprintf' output between 3 and 67 bytes into a destination of size 64
 2861 |     snprintf(dstip, sizeof(dstip), "[%s]", flow->dst_name);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
  • Loading branch information
IvanNardi committed Oct 1, 2024
1 parent bfab402 commit bbde718
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion example/ndpiReader.c
Original file line number Diff line number Diff line change
Expand Up @@ -2839,7 +2839,7 @@ static int is_realtime_protocol(ndpi_protocol proto)
static void dump_realtime_protocol(struct ndpi_workflow * workflow, struct ndpi_flow_info *flow)
{
FILE *out = results_file ? results_file : stdout;
char srcip[64], dstip[64];
char srcip[70], dstip[70];
char ip_proto[64], app_name[64];
char date[64];
int ret = is_realtime_protocol(flow->detected_protocol);
Expand Down

0 comments on commit bbde718

Please sign in to comment.