Hello!

On Wednesday 13 May 2009 03:03:07 Tom Jackson wrote:
> You include the buggy snprintf line above, but this isn't in the patch.

Debian package has _wrong_ locale-dependence fixing patch:
=============================
--- aolserver4-4.5.1.orig/nsd/httptime.c
+++ aolserver4-4.5.1/nsd/httptime.c
@@ -27,6 +27,9 @@
  * version of this file under either the License or the GPL.
  */

+static char *weekdays_names[7] =
+{ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
+

 /*
  * time.c --
@@ -92,11 +95,14 @@
     }

     /*
-     * This will most likely break if the locale is not an english one.
+     * Using snprintf instead of strftime to always use english names
      * The format is RFC 1123: "Sun, 06 Nov 1997 09:12:45 GMT"
      */

-    strftime(buf, 40, "%a, %d %b %Y %H:%M:%S GMT", tmPtr);
+    snprintf(buf, 40, "%s, %d %s %d %02d:%02d:%02d GMT",
+    weekdays_names[tmPtr->tm_wday], tmPtr->tm_mday,
+    month_names[tmPtr->tm_mon], tmPtr->tm_year + 1900,
+    tmPtr->tm_hour, tmPtr->tm_min, tmPtr->tm_sec);

     Ns_DStringAppend(pds, buf);
     return pds->string;
=============================

This patch has bug in line
snprintf(buf, 40, "%s, %d %s %d %02d:%02d:%02d GMT",

I used this patch because my locale is non-english one but I stupidly 
forgot about this.... In my previous mail is attached the fixed patch:
http://mobigroup.ru/files/aol4.5.1/httptime.c.diff

Best regards, Alexey Pechnikov.
http://pechnikov.tel/


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
<[email protected]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to