aboutsummaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorCamil Staps2016-03-02 23:40:25 +0100
committerCamil Staps2016-03-02 23:40:25 +0100
commit2856828c645aa868f9a1caa439cab535427d1f58 (patch)
tree122499e16872beb99284e74955e6a157a5e51807 /compile.c
parentMoved 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.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/compile.c b/compile.c
index 0240698..9e2ac15 100644
--- a/compile.c
+++ b/compile.c
@@ -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;
}