aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-kbdc/paths.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/mds-kbdc/paths.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mds-kbdc/paths.c b/src/mds-kbdc/paths.c
index 7ef8af5..6ad39f1 100644
--- a/src/mds-kbdc/paths.c
+++ b/src/mds-kbdc/paths.c
@@ -33,7 +33,7 @@
*/
char* curpath(void)
{
- static size_t cwd_size = 4096 >> 1;
+ static size_t cwd_size = 4096;
char* cwd = NULL;
char* old = NULL;
int saved_errno;
@@ -42,13 +42,13 @@ char* curpath(void)
* but we will not assume that glibc is used here. */
for (;;)
{
- fail_if (xxrealloc(old, cwd, (cwd_size <<= 1) + 1, char));
+ fail_if (xxrealloc(old, cwd, cwd_size + 1, char));
if (getcwd(cwd, cwd_size))
break;
else
fail_if (errno != ERANGE);
+ cwd_size <<= 1;
}
- cwd_size >>= 1;
return cwd;
fail: