summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2015-01-18 10:58:08 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2015-01-25 19:51:40 -0800
commitfba83e45a8d5dc2ca920ec6c49446d2b54c2db5c (patch)
treead6d8c23b1fdaf2cc303bbae8891dc8fc4233928
parent47fa41960650dd0e97eb78de2af0f5fcd9323b35 (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>
-rw-r--r--util/makestrs.c7
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;
}