aboutsummaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
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;
}