summaryrefslogtreecommitdiff
path: root/src/helper/jim.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/helper/jim.c')
-rw-r--r--src/helper/jim.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/helper/jim.c b/src/helper/jim.c
index a43bcbd6..5eb8c0bb 100644
--- a/src/helper/jim.c
+++ b/src/helper/jim.c
@@ -133,7 +133,9 @@ static char buf[2048];
buf[sizeof(buf)-1] = 0;
#else
char *buf;
- vasprintf( &buf, fmt, ap );
+ int result;
+ result = vasprintf( &buf, fmt, ap );
+ if (result < 0) exit(-1);
#endif
return buf;
}
@@ -8953,7 +8955,7 @@ int Jim_EvalFile(Jim_Interp *interp, const char *filename)
const int cwd_len=2048;
char *cwd=malloc(cwd_len);
Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
- getcwd( cwd, cwd_len );
+ if (!getcwd( cwd, cwd_len )) strcpy(cwd, "unknown");
Jim_AppendStrings(interp, Jim_GetResult(interp),
"Error loading script \"", filename, "\"",
" cwd: ", cwd,