@@ -264,7 +264,7 @@ void fprint_menu0(FILE *fp, struct emailinfo *email, int pos)
264
264
char * id = (pos == PAGE_TOP ) ? "options2" : "options3" ;
265
265
266
266
#ifdef HAVE_ICONV
267
- int tmplen ;
267
+ size_t tmplen ;
268
268
char * tmpptr = i18n_convstring (email -> subject ,"UTF-8" ,email -> charset ,& tmplen );
269
269
#endif
270
270
@@ -766,7 +766,7 @@ void printdates(FILE *fp, struct header *hp, int year, int month, struct emailin
766
766
const char * endline ;
767
767
const char * subj_tag ;
768
768
const char * subj_end_tag ;
769
- static char date_str [DATESTRLEN + 11 ]; /* made static for smaller stack */
769
+ static char date_str [DATESTRLEN + 40 ]; /* made static for smaller stack */
770
770
static char * first_attributes = "<a accesskey=\"j\" name=\"first\" id=\"first\"></a>" ;
771
771
772
772
if (hp != NULL ) {
@@ -796,7 +796,7 @@ void printdates(FILE *fp, struct header *hp, int year, int month, struct emailin
796
796
}
797
797
else
798
798
is_first = TRUE;
799
- sprintf (date_str , "<li>%s<dfn>%s</dfn><ul>\n" ,
799
+ snprintf (date_str , sizeof ( date_str ) , "<li>%s<dfn>%s</dfn><ul>\n" ,
800
800
(is_first ) ? first_attributes : "" , tmp );
801
801
fprintf (fp , "%s" , date_str );
802
802
strcpy (prev_date_str , tmp );
@@ -946,7 +946,11 @@ static char *ConvURLsWithHrefs(const char *line, char *mailid, char *mailsubject
946
946
PushString (& retbuf , tmpline5 );
947
947
free (tmpline5 );
948
948
p += 4 ;
949
- tmpline6 = ConvURLsString (p , mailid , mailsubject , charset );
949
+ tmpline6 = NULL ;
950
+ /* pcm 2007-10-01 disabled the following ConvURLsString call to have */
951
+ /* it escape urls in mid line the same as it did for urls at start of */
952
+ /* line. I'm still puzzled why the change works. */
953
+ /* tmpline6 = ConvURLsString(p, mailid, mailsubject, charset); */
950
954
if (!tmpline6 ) {
951
955
free (PUSH_STRING (retbuf ));
952
956
return NULL ;
@@ -1035,7 +1039,7 @@ char *ConvURLsString(char *line, char *mailid, char *mailsubject, char *charset)
1035
1039
char * c ;
1036
1040
1037
1041
#ifdef HAVE_ICONV
1038
- int tmplen ;
1042
+ size_t tmplen ;
1039
1043
char * tmpptr = i18n_convstring (mailsubject ,"UTF-8" ,charset ,& tmplen );
1040
1044
mailsubject = tmpptr ;
1041
1045
#endif
@@ -1136,7 +1140,7 @@ void printheaders (FILE *fp, struct emailinfo *email)
1136
1140
}
1137
1141
else {
1138
1142
#ifdef HAVE_ICONV
1139
- int tmplen ;
1143
+ size_t tmplen ;
1140
1144
char * tmpptr = i18n_convstring (header_content ,"UTF-8" ,email -> charset ,& tmplen );
1141
1145
ConvURLs (fp , tmpptr , id , subject , email -> charset );
1142
1146
if (tmpptr )
@@ -1333,7 +1337,7 @@ void printbody(FILE *fp, struct emailinfo *email, int maybe_reply, int is_reply)
1333
1337
}
1334
1338
else {
1335
1339
fprintf (fp , "<%s class=\"%s\">" , set_iquotes ? "em" : "span" , find_quote_class (bp -> line ));
1336
-
1340
+
1337
1341
ConvURLs (fp , bp -> line , id , subject , email -> charset );
1338
1342
1339
1343
fprintf (fp , "%s<br />\n" , (set_iquotes ) ? "</em>" : "</span>" );
@@ -1580,7 +1584,7 @@ int print_links_up(FILE *fp, struct emailinfo *email, int pos, int in_thread_fil
1580
1584
if (set_mailcommand && set_hmail ) {
1581
1585
if ((email -> msgid && email -> msgid [0 ]) || (email -> subject && email -> subject [0 ])) {
1582
1586
#ifdef HAVE_ICONV
1583
- int tmplen ;
1587
+ size_t tmplen ;
1584
1588
char * tmpptr = i18n_convstring (email -> subject ,"UTF-8" ,email -> charset ,& tmplen );
1585
1589
ptr = makemailcommand (set_replymsg_command , set_hmail , email -> msgid ,
1586
1590
tmpptr );
@@ -2332,7 +2336,7 @@ void writedates(int amountmsgs, struct emailinfo *email)
2332
2336
int newfile ;
2333
2337
char * filename ;
2334
2338
FILE * fp ;
2335
- char prev_date_str [DATESTRLEN ];
2339
+ char prev_date_str [DATESTRLEN + 40 ];
2336
2340
char * datename = index_name [email && email -> subdir != NULL ][DATE_INDEX ];
2337
2341
time_t start_date_num = email && email -> subdir ? email -> subdir -> first_email -> date : firstdatenum ;
2338
2342
time_t end_date_num = email && email -> subdir ? email -> subdir -> last_email -> date : lastdatenum ;
@@ -2586,7 +2590,7 @@ void printsubjects(FILE *fp, struct header *hp, char **oldsubject,
2586
2590
const char * startline ;
2587
2591
const char * break_str ;
2588
2592
const char * endline ;
2589
- static char date_str [DATESTRLEN + 11 ]; /* made static for smaller stack */
2593
+ static char date_str [DATESTRLEN + 40 ]; /* made static for smaller stack */
2590
2594
static char * first_attributes = "<a accesskey=\"j\" name=\"first\" id=\"first\"></a>" ;
2591
2595
2592
2596
if (hp != NULL ) {
@@ -2626,7 +2630,7 @@ void printsubjects(FILE *fp, struct header *hp, char **oldsubject,
2626
2630
else {
2627
2631
startline = "<li>" ;
2628
2632
break_str = "" ;
2629
- sprintf (date_str , "<em>(%s)</em>" , getindexdatestr (hp -> data -> date ));
2633
+ snprintf (date_str , sizeof ( date_str ) , "<em>(%s)</em>" , getindexdatestr (hp -> data -> date ));
2630
2634
endline = "</li>" ;
2631
2635
}
2632
2636
fprintf (fp ,
@@ -2733,7 +2737,7 @@ void printauthors(FILE *fp, struct header *hp, char **oldname,
2733
2737
const char * startline ;
2734
2738
const char * break_str ;
2735
2739
const char * endline ;
2736
- static char date_str [DATESTRLEN + 11 ]; /* made static for smaller stack */
2740
+ static char date_str [DATESTRLEN + 40 ]; /* made static for smaller stack */
2737
2741
static char * first_attributes = "<a accesskey=\"j\" name=\"first\" id=\"first\"></a>" ;
2738
2742
2739
2743
if (hp != NULL ) {
@@ -2781,7 +2785,7 @@ void printauthors(FILE *fp, struct header *hp, char **oldname,
2781
2785
else {
2782
2786
startline = "<li>" ;
2783
2787
break_str = " " ;
2784
- sprintf (date_str , "<em>(%s)</em>" , getindexdatestr (hp -> data -> date ));
2788
+ snprintf (date_str , sizeof ( date_str ) , "<em>(%s)</em>" , getindexdatestr (hp -> data -> date ));
2785
2789
endline = "</li>" ;
2786
2790
}
2787
2791
fprintf (fp ,"%s%s%s</a>%s<a name=\"%d\" id=\"%d\">%s</a>%s\n" ,
@@ -3055,7 +3059,7 @@ static void printmonths(FILE *fp, char *summary_filename, int amountmsgs)
3055
3059
switch (j ) {
3056
3060
case DATE_INDEX :
3057
3061
{
3058
- char prev_date_str [DATESTRLEN ];
3062
+ char prev_date_str [DATESTRLEN + 40 ];
3059
3063
prev_date_str [0 ] = '\0' ;
3060
3064
printdates (fp1 , datelist , y , m , NULL , prev_date_str );
3061
3065
if (* prev_date_str ) /* close the previous date item */
0 commit comments