You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2023/03/14 12:19:34 UTC

svn commit: r1908383 - /httpd/httpd/trunk/server/util_time.c

Author: ylavic
Date: Tue Mar 14 12:19:34 2023
New Revision: 1908383

URL: http://svn.apache.org/viewvc?rev=1908383&view=rev
Log:
util_time: Note/comments about ap_recent_ctime_ex() correctness wrt trailing \0


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

Modified: httpd/httpd/trunk/server/util_time.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_time.c?rev=1908383&r1=1908382&r2=1908383&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_time.c (original)
+++ httpd/httpd/trunk/server/util_time.c Tue Mar 14 12:19:34 2023
@@ -25,7 +25,7 @@
  *   */
 #define AP_CTIME_USEC_LENGTH      7
 
-/* Length of ISO 8601 date/time */
+/* Length of ISO 8601 date/time (including trailing '\0') */
 #define AP_CTIME_COMPACT_LEN      20
 
 /* Length of timezone offset from GMT ([+-]hhmm) plus leading space */
@@ -190,7 +190,9 @@ AP_DECLARE(apr_status_t) ap_recent_ctime
         needed += AP_CTIME_GMTOFF_LEN;
     }
 
-    /* Check the provided buffer length */
+    /* Check the provided buffer length (note: above AP_CTIME_COMPACT_LEN
+     * and APR_CTIME_LEN include the trailing '\0'; so does 'needed' then).
+     */
     if (len && *len >= needed) {
         *len = needed;
     }