Skip to content

Commit

Permalink
improved previous fix a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
pzaino committed Dec 1, 2023
1 parent fe200bf commit 39d2a29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zvector.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ static void *safe_strncpy(const char * const str_src,
void *str_dst = NULL;
char tmp_dst[max_len];
memset(tmp_dst, 0, max_len - 1);
memcpy(tmp_dst, str_src, max_len - 1);
strncpy(tmp_dst, str_src, max_len - 1);
tmp_dst[max_len - 1] = 0;

str_dst = malloc(sizeof(char) * (strlen(tmp_dst) + 1));
Expand Down

0 comments on commit 39d2a29

Please sign in to comment.