From cb29bbc8148468bbbea09031a85f0a4a5f8b1b1d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 10 Dec 2014 16:30:54 +0100 Subject: m simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-kbdc/paths.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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: -- cgit v1.2.3-70-g09d2