mirror of
https://git.FreeBSD.org/ports.git
synced 2024-10-30 21:49:25 +00:00
e563579165
- fix memoly leak when using getaddrinfo() - support draft-ietf-drums-msg-fmt-07 Partly submitted by: Hideaki YOSHIFUJI <yoshfuji@ecei.tohoku.ac.jp> Approved by: maintainer
43 lines
1.3 KiB
Plaintext
43 lines
1.3 KiB
Plaintext
--- ../src/mnews.c.orig Wed Dec 15 00:29:56 1999
|
||
+++ ../src/mnews.c Sun Jan 16 07:37:37 2000
|
||
@@ -2870,8 +2870,17 @@
|
||
}
|
||
dates = next_param(dates);
|
||
*year = atoi(dates); /* 年 */
|
||
- if ((*year > 0) && (*year < 1000)) {
|
||
- *year += 1900;
|
||
+ if ((*year >= 0) && (*year < 1000)){
|
||
+#ifdef Y2K_DONT_CONVERT_YEAR_00XX
|
||
+ for (i = 0; i < 5; i++)
|
||
+ if (dates[i] == '\0' || !isdigit(dates[i])) break;
|
||
+ if (i < 4){
|
||
+#endif
|
||
+ /* [Y2K] 1~3桁年表示日付変換 */
|
||
+ *year += (*year < 50) ? 2000 : 1900; /* draft-ietf-drums-msg-fmt-07 */
|
||
+#ifdef Y2K_DONT_CONVERT_YEAR_00XX
|
||
+ }
|
||
+#endif
|
||
}
|
||
dates = next_param(dates);
|
||
} else { /* Date, Day Month Year Time Zone */
|
||
@@ -2885,8 +2894,17 @@
|
||
}
|
||
dates = next_param(dates);
|
||
*year = atoi(dates); /* 年 */
|
||
- if ((*year > 0) && (*year < 1000)) {
|
||
- *year += 1900;
|
||
+ if ((*year >= 0) && (*year < 1000)){
|
||
+#ifdef Y2K_DONT_CONVERT_YEAR_00XX
|
||
+ for (i = 0; i < 5; i++)
|
||
+ if (dates[i] == '\0' || !isdigit(dates[i])) break;
|
||
+ if (i < 4){
|
||
+#endif
|
||
+ /* [Y2K] 1~3桁年表示日付変換 */
|
||
+ *year += (*year < 50) ? 2000 : 1900; /* draft-ietf-drums-msg-fmt-07 */
|
||
+#ifdef Y2K_DONT_CONVERT_YEAR_00XX
|
||
+ }
|
||
+#endif
|
||
}
|
||
dates = next_param(dates);
|
||
*hour = atoi(dates); /* 時 */
|