summaryrefslogtreecommitdiff
path: root/ext/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'ext/calendar')
-rw-r--r--ext/calendar/cal_unix.c2
-rw-r--r--ext/calendar/calendar.c18
-rw-r--r--ext/calendar/easter.c2
-rw-r--r--ext/calendar/package.xml2
-rw-r--r--ext/calendar/tests/easter_date.phpt6
-rw-r--r--ext/calendar/tests/unixtojd.phpt2
6 files changed, 16 insertions, 16 deletions
diff --git a/ext/calendar/cal_unix.c b/ext/calendar/cal_unix.c
index b4d920add..97c138df2 100644
--- a/ext/calendar/cal_unix.c
+++ b/ext/calendar/cal_unix.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
+ | Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c
index d4cbc490d..2e914ae42 100644
--- a/ext/calendar/calendar.c
+++ b/ext/calendar/calendar.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
+ | Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,7 +18,7 @@
| Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: calendar.c,v 1.46.2.2.2.1 2006/06/11 01:42:16 bjori 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 @@ PHP_FUNCTION(cal_from_jd)
calendar->from_jd(jd, &year, &month, &day);
- sprintf(date, "%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 @@ PHP_FUNCTION(jdtogregorian)
}
SdnToGregorian(julday, &year, &month, &day);
- sprintf(date, "%i/%i/%i", month, day, year);
+ snprintf(date, sizeof(date), "%i/%i/%i", month, day, year);
RETURN_STRING(date, 1);
}
@@ -480,7 +480,7 @@ PHP_FUNCTION(jdtojulian)
}
SdnToJulian(julday, &year, &month, &day);
- sprintf(date, "%i/%i/%i", month, day, year);
+ snprintf(date, sizeof(date), "%i/%i/%i", month, day, year);
RETURN_STRING(date, 1);
}
@@ -602,7 +602,7 @@ PHP_FUNCTION(jdtojewish)
long julday, fl = 0;
zend_bool heb = 0;
int year, month, day;
- char date[16], hebdate[25];
+ char date[16], hebdate[32];
char *dayp, *yearp;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|bl", &julday, &heb, &fl) == FAILURE) {
@@ -611,7 +611,7 @@ PHP_FUNCTION(jdtojewish)
SdnToJewish(julday, &year, &month, &day);
if (!heb) {
- sprintf(date, "%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 @@ PHP_FUNCTION(jdtojewish)
RETURN_FALSE;
}
- sprintf(hebdate, "%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 @@ PHP_FUNCTION(jdtofrench)
}
SdnToFrench(julday, &year, &month, &day);
- sprintf(date, "%i/%i/%i", month, day, year);
+ snprintf(date, sizeof(date), "%i/%i/%i", month, day, year);
RETURN_STRING(date, 1);
}
diff --git a/ext/calendar/easter.c b/ext/calendar/easter.c
index 21779d11d..6329986e4 100644
--- a/ext/calendar/easter.c
+++ b/ext/calendar/easter.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
+ | Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/calendar/package.xml b/ext/calendar/package.xml
index 877b74512..82d067529 100644
--- a/ext/calendar/package.xml
+++ b/ext/calendar/package.xml
@@ -44,7 +44,7 @@ different from the Julian Calendar!
<version>5.0.0rc1</version>
<date>2004-03-19</date>
<notes>
-package.xml added to support intallation using pear installer
+package.xml added to support installation using pear installer
</notes>
<filelist>
<file role="doc" name="CREDITS"/>
diff --git a/ext/calendar/tests/easter_date.phpt b/ext/calendar/tests/easter_date.phpt
index 55a3670da..1adff6929 100644
--- a/ext/calendar/tests/easter_date.phpt
+++ b/ext/calendar/tests/easter_date.phpt
@@ -12,9 +12,9 @@ echo date("Y-m-d", easter_date(2002))."\n";
echo date("Y-m-d", easter_date(1492))."\n";
?>
--EXPECTF--
-2000-04-22
-2001-04-14
-2002-03-30
+2000-04-23
+2001-04-15
+2002-03-31
Warning: easter_date(): This function is only valid for years between 1970 and 2037 inclusive in %s on line %d
1970-01-01
diff --git a/ext/calendar/tests/unixtojd.phpt b/ext/calendar/tests/unixtojd.phpt
index 567a8c25b..e8e953c37 100644
--- a/ext/calendar/tests/unixtojd.phpt
+++ b/ext/calendar/tests/unixtojd.phpt
@@ -10,5 +10,5 @@ echo unixtojd(1152459009). "\n";
?>
--EXPECT--
2440588
-2452162
+2452161
2453926