diff options
author | Greg Hudson <ghudson@mit.edu> | 2008-10-20 21:14:47 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2008-10-20 21:14:47 +0000 |
commit | ae423f53214830de1367627180031283de998746 (patch) | |
tree | f3268a5a9d718d570883bf296c52c117e0dfc709 /src/util/et | |
parent | cdea7397975a960e3c02479f8aa4ede0bc349105 (diff) | |
download | krb5-ae423f53214830de1367627180031283de998746.tar.gz krb5-ae423f53214830de1367627180031283de998746.tar.xz krb5-ae423f53214830de1367627180031283de998746.zip |
Use asprintf instead of malloc/strcpy/strcat in many places
ticket: 6200
status: open
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20901 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util/et')
-rw-r--r-- | src/util/et/error_table.y | 5 | ||||
-rw-r--r-- | src/util/et/internal.h | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/util/et/error_table.y b/src/util/et/error_table.y index 6162d61b52..750e9d9734 100644 --- a/src/util/et/error_table.y +++ b/src/util/et/error_table.y @@ -108,10 +108,7 @@ quote(string) char const *string; { char *rv; - rv = malloc(strlen(string)+3); - strcpy(rv, "\""); - strcat(rv, string); - strcat(rv, "\""); + asprintf(&rv, "\"%s\"", string); return(rv); } diff --git a/src/util/et/internal.h b/src/util/et/internal.h index 57b5cd58e5..f3e3abef39 100644 --- a/src/util/et/internal.h +++ b/src/util/et/internal.h @@ -5,6 +5,8 @@ #include <errno.h> +#include "k5-platform.h" + #ifndef SYS_ERRLIST_DECLARED extern char const * const sys_errlist[]; extern const int sys_nerr; |