diff options
| author | mattn <[email protected]> | 2012-12-11 11:44:09 +0900 |
|---|---|---|
| committer | mattn <[email protected]> | 2012-12-11 11:44:09 +0900 |
| commit | 90bd7371646ad7b800550de614e1d2035b2107e1 (patch) | |
| tree | be9ac9e18073c84c59d15148b21815d39318c5c0 | |
| parent | 57482ef3f04f158b9ec2f73369e1b697de8124c3 (diff) | |
| download | mruby-90bd7371646ad7b800550de614e1d2035b2107e1.tar.gz mruby-90bd7371646ad7b800550de614e1d2035b2107e1.zip | |
fix generator.
| -rw-r--r-- | mrbgems/generator.c | 5 |
1 files 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) |
