Skip to content

Commit

Permalink
nul-terminate newcwd. should fix #600
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Mar 17, 2012
1 parent 8587dd4 commit 2810be1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ void jl_load_file_expr(char *fname, jl_value_t *ast)
size_t n = (sep - fname)+1;
if (n > sizeof(newcwd)-1) n = sizeof(newcwd)-1;
strncpy(newcwd, fname, n);
newcwd[n] = '\0';
set_cwd(newcwd);
}
JL_TRY {
Expand Down

0 comments on commit 2810be1

Please sign in to comment.