Skip to content

Commit

Permalink
test: packet_gen: clean up odph_strcpy call
Browse files Browse the repository at this point in the history
Now that odph_strcpy doesn't warn about string truncation anymore,
there's no need to avoid it here.

Signed-off-by: Jere Leppänen <[email protected]>
Reviewed-by: Tuomas Taipale <[email protected]>
  • Loading branch information
JereLeppanen authored and MatiasElo committed Sep 5, 2024
1 parent 2ae33e9 commit 723af95
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/performance/odp_packet_gen.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ enum {
ODP_STATIC_ASSERT(MAX_PKTIOS <= UINT8_MAX, "Interface index must fit into uint8_t\n");

typedef struct {
char name[MAX_HDR_NAME_LEN + 2];
char name[MAX_HDR_NAME_LEN + 1];
uint64_t value;
int64_t diff;
uint32_t len;
Expand Down Expand Up @@ -447,9 +447,7 @@ static odp_bool_t parse_custom_fields(const char *optarg, test_options_t *opts)
}

hdr = &opts->custom_l3.fields[num_fields];
/* Need to have +2 to size as does not compile due to truncation errors even though
destination has ample room. */
odph_strcpy(hdr->name, name, MAX_HDR_NAME_LEN + 2);
odph_strcpy(hdr->name, name, MAX_HDR_NAME_LEN + 1);
hdr->value = value;
hdr->diff = diff;
hdr->len = len;
Expand Down

0 comments on commit 723af95

Please sign in to comment.