From fba83e45a8d5dc2ca920ec6c49446d2b54c2db5c Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 18 Jan 2015 10:58:08 -0800 Subject: makestrs: Replace strcpy()+strcat() calls with snprintf() calls Signed-off-by: Alan Coopersmith Reviewed-by: Hans de Goede --- util/makestrs.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'util') 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; } -- cgit v1.2.1