summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2015-01-17 18:46:49 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2015-01-17 18:46:49 -0800
commit8eefb5a18de41b693c00767458ee51f034201ebf (patch)
treec1508e2ddf7d902f19b26acbb4a8be90e7e14308
parenta5221fc11307eb1230ae2643c6e423b0f7867fde (diff)
Replace strcpy+strcat calls with snprintf calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/encparse.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/encparse.c b/src/encparse.c
index ca4fc0f..8ef6f36 100644
--- a/src/encparse.c
+++ b/src/encparse.c
@@ -801,8 +801,7 @@ parseFontFileName(const char *fontFileName, char *buf, char *dir)
*lastslash = '\0';
if(buf && strlen(dir) + 14 < MAXFONTFILENAMELEN) {
- strcpy(buf, dir);
- strcat(buf, "encodings.dir");
+ snprintf(buf, MAXFONTFILENAMELEN, "%s%s", dir, "encodings.dir");
}
}
@@ -850,10 +849,9 @@ FontEncReallyReallyLoad(const char *charset,
fclose(file);
return NULL;
}
- strcpy(buf, dir);
- strcat(buf, file_name);
+ snprintf(buf, MAXFONTFILENAMELEN, "%s%s", dir, file_name);
} else {
- strcpy(buf , file_name);
+ snprintf(buf, MAXFONTFILENAMELEN, "%s", file_name);
}
f = FontFileOpen(buf);