aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/paths.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-05-06 22:35:54 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-05-06 22:35:54 -0400
commitaaa68bd1d48087e6e180bbe6563c5aa280ae5e34 (patch)
tree857e01a4466c7c1d8dd81063cec7d24e2ccce9fc /src/stdlib/paths.c
parenta08148694ef6791bfa66ed6a46728df83205f00f (diff)
Check return value
Diffstat (limited to 'src/stdlib/paths.c')
-rw-r--r--src/stdlib/paths.c3
1 files changed, 2 insertions, 1 deletions
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);
}