diff options
author | 2003-04-05 15:39:22 +0000 | |
---|---|---|
committer | 2003-04-05 15:39:22 +0000 | |
commit | 538b861676f7495611f900ba71b4f325aea8a567 (patch) | |
tree | 5e8aa4a4138ccce78239efc4eca3353fc19275db | |
parent | say goodbye to strcpy, okay deraadt@ (diff) | |
download | wireguard-openbsd-538b861676f7495611f900ba71b4f325aea8a567.tar.xz wireguard-openbsd-538b861676f7495611f900ba71b4f325aea8a567.zip |
strlcpy
-rw-r--r-- | usr.bin/compile_et/error_table.y | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/compile_et/error_table.y b/usr.bin/compile_et/error_table.y index 93ed55f7555..350af9ad22b 100644 --- a/usr.bin/compile_et/error_table.y +++ b/usr.bin/compile_et/error_table.y @@ -106,9 +106,10 @@ statement : INDEX NUMBER } | PREFIX STRING { - prefix = realloc(prefix, strlen($2) + 2); - strcpy(prefix, $2); - strcat(prefix, "_"); + size_t len = strlen($2) + 2; + prefix = realloc(prefix, len); + strlcpy(prefix, $2, len); + strlcat(prefix, "_", len); free($2); } | PREFIX |