From 90bd7371646ad7b800550de614e1d2035b2107e1 Mon Sep 17 00:00:00 2001 From: mattn Date: Tue, 11 Dec 2012 11:44:09 +0900 Subject: fix generator. --- mrbgems/generator.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mrbgems/generator.c b/mrbgems/generator.c index 108405b24..915c2b914 100644 --- a/mrbgems/generator.c +++ b/mrbgems/generator.c @@ -28,7 +28,7 @@ static char static char *get_full_path(char *path, char *mruby_root) { - char full_path[1024] = { 0 }; + static char full_path[1024] = { 0 }; if (path[0] == '/') { /* An absolute UNIX path starts with a slash */ strcpy(full_path, path); @@ -75,7 +75,7 @@ static char } } - ret = malloc(i + count * (newlen - oldlen)); + ret = malloc(i + count * (newlen - oldlen) + 1); if (ret == NULL) exit(EXIT_FAILURE); @@ -184,6 +184,7 @@ for_each_gem (char before[1024], char after[1024], skip = FALSE; else skip = TRUE; + fclose(check); } if (skip == FALSE) -- cgit v1.2.3