From fbeadc3cc40fd35c912799901204d81b60e08c5f Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Fri, 10 Sep 2010 17:00:08 +0000 Subject: [PATCH] readability fix, as suggested by Ruediger Pluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@995870 13f79535-47bb-0310-9956-ffa450edef68 --- server/log.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/server/log.c b/server/log.c index e865628183..80b28443fd 100644 --- a/server/log.c +++ b/server/log.c @@ -820,15 +820,12 @@ static void add_log_id(const conn_rec *c, const request_rec *r) } #endif - len = apr_base64_encode_len(sizeof(id)); + len = apr_base64_encode_len(sizeof(id)); /* includes trailing \0 */ encoded = apr_palloc(r ? r->pool : c->pool, len); apr_base64_encode(encoded, (char *)&id, sizeof(id)); - /* - * Only the first 11 chars are significant, the last (12th) char is - * always '='. - */ - encoded[11] = '\0'; + /* Skip the last char, it is always '=' */ + encoded[len - 2] = '\0'; /* need to cast const away */ if (r) { -- 2.50.1