From aaa68bd1d48087e6e180bbe6563c5aa280ae5e34 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 6 May 2025 22:35:54 -0400 Subject: Check return value --- src/stdlib/paths.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/stdlib/paths.c b/src/stdlib/paths.c index 86095f76..6b16916c 100644 --- a/src/stdlib/paths.c +++ b/src/stdlib/paths.c @@ -717,7 +717,8 @@ public List_t Path$glob(Path_t path) public Path_t Path$current_dir(void) { char cwd[PATH_MAX]; - getcwd(cwd, sizeof(cwd)); + if (getcwd(cwd, sizeof(cwd)) == NULL) + fail("Could not get current working directory"); return Path$from_str(cwd); } -- cgit v1.2.3