summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-05 15:39:23 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-05 15:39:23 +0000
commita3633d0926ef1e0ecdc3c0009dc7170a2e1038fd (patch)
tree002589879ab4d38a9840211f19c6f619b44641fa
parentbee95b770b534635d55d823d4096634687dabde1 (diff)
strlcpy
-rw-r--r--usr.bin/compile_et/error_table.y7
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