Skip to content

Commit

Permalink
Make string array data const
Browse files Browse the repository at this point in the history
  • Loading branch information
erer1243 committed Jan 8, 2025
1 parent a78e4ec commit 79230df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/c-api/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ typedef enum {
// data strings should be freed with libc's free()
typedef struct {
uint64_t len;
char **data;
const char **data;
} SWSSStringArray;

// data should not include a null terminator
Expand Down Expand Up @@ -227,7 +227,7 @@ template <class T> static inline SWSSKeyOpFieldValuesArray makeKeyOpFieldValuesA
}

static inline SWSSStringArray makeStringArray(std::vector<std::string> &&in) {
char **data = new char*[in.size()];
const char **data = new const char*[in.size()];

size_t i = 0;
for (std::string &s : in)
Expand Down

0 comments on commit 79230df

Please sign in to comment.