stas            Fri Feb 16 18:32:38 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/calendar       calendar.c 
  Log:
  fix snprintf size 
  #-1 is not needed
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/calendar/calendar.c?r1=1.46.2.2.2.3&r2=1.46.2.2.2.4&diff_format=u
Index: php-src/ext/calendar/calendar.c
diff -u php-src/ext/calendar/calendar.c:1.46.2.2.2.3 
php-src/ext/calendar/calendar.c:1.46.2.2.2.4
--- php-src/ext/calendar/calendar.c:1.46.2.2.2.3        Fri Feb 16 18:24:16 2007
+++ php-src/ext/calendar/calendar.c     Fri Feb 16 18:32:38 2007
@@ -18,7 +18,7 @@
    |          Wez Furlong               <[EMAIL PROTECTED]>            |
    +----------------------------------------------------------------------+
  */
-/* $Id: calendar.c,v 1.46.2.2.2.3 2007/02/16 18:24:16 stas Exp $ */
+/* $Id: calendar.c,v 1.46.2.2.2.4 2007/02/16 18:32:38 stas Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -416,7 +416,7 @@
 
        calendar->from_jd(jd, &year, &month, &day);
 
-       snprintf(date, sizeof(date)-1, "%i/%i/%i", month, day, year);
+       snprintf(date, sizeof(date), "%i/%i/%i", month, day, year);
        add_assoc_string(return_value, "date", date, 1);
 
        add_assoc_long(return_value, "month", month);
@@ -447,7 +447,7 @@
        }
 
        SdnToGregorian(julday, &year, &month, &day);
-       snprintf(date, sizeof(date)-1, "%i/%i/%i", month, day, year);
+       snprintf(date, sizeof(date), "%i/%i/%i", month, day, year);
 
        RETURN_STRING(date, 1);
 }
@@ -480,7 +480,7 @@
        }
 
        SdnToJulian(julday, &year, &month, &day);
-       snprintf(date, sizeof(date)-1, "%i/%i/%i", month, day, year);
+       snprintf(date, sizeof(date), "%i/%i/%i", month, day, year);
 
        RETURN_STRING(date, 1);
 }
@@ -611,7 +611,7 @@
 
        SdnToJewish(julday, &year, &month, &day);
        if (!heb) {
-               snprintf(date, sizeof(date)-1, "%i/%i/%i", month, day, year);
+               snprintf(date, sizeof(date), "%i/%i/%i", month, day, year);
                RETURN_STRING(date, 1);
        } else {
                if (year <= 0 || year > 9999) {
@@ -619,7 +619,7 @@
                        RETURN_FALSE;
                }
 
-               snprintf(hebdate, sizeof(hebdate)-1, "%s %s %s", 
heb_number_to_chars(day, fl, &dayp), JewishMonthHebName[month], 
heb_number_to_chars(year, fl, &yearp));
+               snprintf(hebdate, sizeof(hebdate), "%s %s %s", 
heb_number_to_chars(day, fl, &dayp), JewishMonthHebName[month], 
heb_number_to_chars(year, fl, &yearp));
 
                if (dayp) {
                        efree(dayp);
@@ -661,7 +661,7 @@
        }
 
        SdnToFrench(julday, &year, &month, &day);
-       snprintf(date, sizeof(date)-1, "%i/%i/%i", month, day, year);
+       snprintf(date, sizeof(date), "%i/%i/%i", month, day, year);
 
        RETURN_STRING(date, 1);
 }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to