summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/hash.c b/hash.c
index e847b4dd3a..f28b15f5f4 100644
--- a/hash.c
+++ b/hash.c
@@ -2198,13 +2198,9 @@ envix(const char *nam)
static int
getenvsize(char* p)
{
- char prev = *p++;
- int len = 1;
- for (; prev || *p; p++) {
- prev = *p;
- len++;
- }
- return len;
+ char* porg = p;
+ while (*p || *(p + 1)) ++p;
+ return p - porg + 1;
}
#endif