summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-05-13 12:14:58 (GMT)
committer John Mark Bell <jmb@netsurf-browser.org>2009-05-13 12:14:58 (GMT)
commit7e10d640d86cacfd16481037985f994d9ed189eb (patch)
treee0474486cf05000703443f2da99e999e1d3fea30
parent48d44fe3cc442f37fd155e2da99ca7cae8b3a673 (diff)
downloadttf2f-7e10d640d86cacfd16481037985f994d9ed189eb.tar.gz
ttf2f-7e10d640d86cacfd16481037985f994d9ed189eb.tar.bz2
Ensure path is NUL-terminated when creating directories
svn path=/trunk/tools/ttf2f/; revision=7499
-rw-r--r--src/toolbox.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/toolbox.c b/src/toolbox.c
index 55f46a2..2c4bf5a 100644
--- a/src/toolbox.c
+++ b/src/toolbox.c
@@ -298,7 +298,7 @@ osbool convert_font(bits event_code, toolbox_action *event,
{
os_error *error, erblock = { 123456, "Invalid Parameters" };
char ifilename[256], ofilename[256], save_in[1024];
- char *dot, *last_dot, *save;
+ char *dot, *save;
int fail;
ttf2f_ctx ctx;
ttf2f_result res;
@@ -346,11 +346,11 @@ osbool convert_font(bits event_code, toolbox_action *event,
}
/* create output directories */
- last_dot = ofilename;
save = save_in + strlen(save_in);
- for (dot = last_dot; *dot != '\0'; dot++) {
+ for (dot = ofilename; *dot != '\0'; dot++) {
if (*dot == '.') {
+ (*save) = '\0';
error = xosfile_create_dir(save_in, 0);
if (error) {
fprintf(stderr, "os_file: 0x%x: %s\n",