diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2015-01-18 10:58:08 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2015-01-25 19:51:40 -0800 |
commit | fba83e45a8d5dc2ca920ec6c49446d2b54c2db5c (patch) | |
tree | ad6d8c23b1fdaf2cc303bbae8891dc8fc4233928 /util | |
parent | 47fa41960650dd0e97eb78de2af0f5fcd9323b35 (diff) |
makestrs: Replace strcpy()+strcat() calls with snprintf() calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'util')
-rw-r--r-- | util/makestrs.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/util/makestrs.c b/util/makestrs.c index 7853f87..f872ec8 100644 --- a/util/makestrs.c +++ b/util/makestrs.c @@ -102,9 +102,7 @@ static FILE *ifopen(const char *file, const char *mode) if (buffer == NULL) return NULL; - strcpy(buffer, includedir); - strcat(buffer, "/"); - strcat(buffer, file); + snprintf(buffer, len + 1, "%s/%s", includedir, file); ret = fopen(buffer, mode); @@ -580,8 +578,7 @@ static void DoLine(char *buf) else right = buf + 1; if (buf[0] == 'H') { - strcpy (lbuf, prefixstr); - strcat (lbuf, right); + snprintf (lbuf, sizeof(lbuf), "%s%s", prefixstr, right); right = lbuf; } |