diff options
author | Camil Staps | 2016-03-02 23:40:25 +0100 |
---|---|---|
committer | Camil Staps | 2016-03-02 23:40:25 +0100 |
commit | 2856828c645aa868f9a1caa439cab535427d1f58 (patch) | |
tree | 122499e16872beb99284e74955e6a157a5e51807 /compile.c | |
parent | Moved runflags to clmflags (diff) |
Implemented memory
Not release ready:
- Cannot forget things
- Not documented in Readme
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; } |