summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-05-11 00:14:15 -0700
committerOri Bernstein <ori@eigenstate.org>2018-05-11 00:14:15 -0700
commit5e304164f4acfdd78208838a64185f833a7d48db (patch)
tree1b02e0c4d06ad4b3cdfeec4078504d7587dcffb4
parent1d4b554015ba6bb9cce2902a648e4b5af2811df5 (diff)
downloadmc-5e304164f4acfdd78208838a64185f833a7d48db.tar.gz
Check return value of getcwd.
Some systems warn.
-rw-r--r--6/gengas.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/6/gengas.c b/6/gengas.c
index cae0db8..aa0157a 100644
--- a/6/gengas.c
+++ b/6/gengas.c
@@ -350,7 +350,8 @@ genfunc(FILE *fd, Func *fn, Htab *globls, Htab *strtab)
char cwd[1024];
resetregs();
- getcwd(cwd, sizeof cwd);
+ if (!getcwd(cwd, sizeof cwd))
+ die("getcwd failed: %s\n", cwd);
is.reglocs = mkht(varhash, vareq);
is.name = fn->name;
is.stkoff = fn->stkoff;