aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-01-24 05:51:13 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-01-24 05:51:13 +0000
commit787e886ff0281e53432366cca8456c210d3a919c (patch)
tree0a21472a3df30eb89e6657d9111f909825e0f910
parentfix infinite loop/oom when cwd longer then 1024 (diff)
client: port bfabc5450b3a01c7d701809b3cf6158220ea289e to footclient
-rw-r--r--client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/client.c b/client.c
index 757f4d41..dabcc327 100644
--- a/client.c
+++ b/client.c
@@ -401,10 +401,10 @@ main(int argc, char *const *argv)
const char *cwd = custom_cwd;
if (cwd == NULL) {
- errno = 0;
size_t buf_len = 1024;
do {
_cwd = xrealloc(_cwd, buf_len);
+ errno = 0;
if (getcwd(_cwd, buf_len) == NULL && errno != ERANGE) {
LOG_ERRNO("failed to get current working directory");
goto err;