httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r995870 - /httpd/httpd/trunk/server/log.c
Date Fri, 10 Sep 2010 17:00:08 GMT
Author: sf
Date: Fri Sep 10 17:00:08 2010
New Revision: 995870

URL: http://svn.apache.org/viewvc?rev=995870&view=rev
Log:
readability fix, as suggested by Ruediger Pluem

Modified:
    httpd/httpd/trunk/server/log.c

Modified: httpd/httpd/trunk/server/log.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/log.c?rev=995870&r1=995869&r2=995870&view=diff
==============================================================================
--- httpd/httpd/trunk/server/log.c (original)
+++ httpd/httpd/trunk/server/log.c Fri Sep 10 17:00:08 2010
@@ -820,15 +820,12 @@ static void add_log_id(const conn_rec *c
     }
 #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) {



Mime
View raw message