diff options
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -88,14 +88,14 @@ int64_t compile(CleanString path, CleanString module) { * * @return void */ -void run(CleanString executable) { +int64_t run(CleanString executable) { char* execchars; int execlength; // Copy CleanString to char[] execlength = CleanStringLength(executable); - execchars = calloc(sizeof(char), execlength + 1 + 4); + execchars = calloc(1, execlength + 1); if (execchars == NULL) { printf("Couldn't allocate memory\n"); exit(-1); @@ -106,10 +106,10 @@ void run(CleanString executable) { execchars[i] = CleanStringCharacters(executable)[i]; execchars[i] = 0x00; - // Build & run command: - // <module> -nt - strcat(execchars, " -nt"); - system(execchars); + // Run command: + int r; + r = system(execchars); free(execchars); + return r; } |