]> granicus.if.org Git - apache/commitdiff
readability fix, as suggested by Ruediger Pluem
authorStefan Fritsch <sf@apache.org>
Fri, 10 Sep 2010 17:00:08 +0000 (17:00 +0000)
committerStefan Fritsch <sf@apache.org>
Fri, 10 Sep 2010 17:00:08 +0000 (17:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@995870 13f79535-47bb-0310-9956-ffa450edef68

server/log.c

index e865628183659012d0a92760eee213cf00322d20..80b28443fd7f434e95c3f632dfe6bd847be7965e 100644 (file)
@@ -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) {