Skip to content

Commit 1026173

Browse files
author
Peter McCluskey
committed
change int to size_t
1 parent 28b04f5 commit 1026173

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

src/parse.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
#include <sys/dir.h>
4949
#endif
5050

51+
#ifdef HAVE_STRING_H
52+
#include <string.h>
53+
#endif
54+
5155
/*
5256
** LCC doesn't have lstat() defined in sys/stat.h. We'll define it
5357
** in lcc_extras.h, but really it just calls stat().
@@ -862,7 +866,7 @@ static char *mdecodeRFC2047(char *string, int length, char *charsetsave)
862866

863867
#ifdef HAVE_ICONV
864868
char *orig2,*output2,*output3;
865-
int len;
869+
size_t len;
866870
orig2=output2=malloc(strlen(string)+1);
867871
memset(output2,0,strlen(string)+1);
868872
old_output=output;
@@ -3103,7 +3107,7 @@ int parse_old_html(int num, struct emailinfo *ep, int parse_body,
31033107
#if HAVE_ICONV
31043108
if (charset){
31053109
char *tmpptr;
3106-
int tmplen=0;
3110+
size_t tmplen=0;
31073111
tmpptr=subject;
31083112
subject=i18n_convstring(tmpptr,charset,"UTF-8",&tmplen);
31093113
if(tmpptr)

src/print.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
#endif
4747
#endif
4848

49+
#ifdef HAVE_STRING_H
50+
#include <string.h>
51+
#endif
52+
4953
static char *indextypename[NO_INDEX];
5054

5155
#ifdef GDBM
@@ -1412,7 +1416,7 @@ void print_headers(FILE *fp, struct emailinfo *email, int in_thread_file)
14121416
fprintf(fp, "<address class=\"headers\">\n");
14131417

14141418
#ifdef HAVE_ICONV
1415-
int tmplen;
1419+
size_t tmplen;
14161420
char *tmpsubject=i18n_convstring(email->subject,"UTF-8",email->charset,&tmplen);
14171421
char *tmptmpname=i18n_convstring(email->name,"UTF-8",email->charset,&tmplen);
14181422
char *tmpname=convchars(tmptmpname,"utf-8");
@@ -2040,7 +2044,7 @@ void writearticles(int startnum, int maxnum)
20402044
char *ptr;
20412045
#ifdef HAVE_ICONV
20422046
char *localsubject=NULL,*localname=NULL;
2043-
int convlen=0;
2047+
size_t convlen=0;
20442048
#endif
20452049

20462050

src/proto.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void dump_config(void);
9393
/*
9494
** string.c functions
9595
*/
96-
char *i18n_convstring(char *, char *, char *, int *);
96+
char *i18n_convstring(char *, char *, char *, size_t *);
9797
char *i18n_utf2numref(char *, int);
9898
char *i18n_numref2utf(char *);
9999

src/string.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
#include "parse.h"
2929
#include "uconvert.h"
3030

31+
#ifdef HAVE_STRING_H
32+
#include <string.h>
33+
#endif
34+
3135
/* I18N hack */
3236
#ifdef HAVE_ICONV_H
3337
#include <iconv.h>
@@ -93,9 +97,9 @@ char *i18n_canonicalize_charset(char *cs){
9397
}
9498

9599

96-
char *i18n_convstring(char *string, char *fromcharset, char *tocharset, int *len){
100+
char *i18n_convstring(char *string, char *fromcharset, char *tocharset, size_t *len){
97101

98-
int origlen,strleft,bufleft;
102+
size_t origlen,strleft,bufleft;
99103
char *convbuf,*origconvbuf;
100104
iconv_t iconvfd;
101105
size_t ret;
@@ -1226,7 +1230,7 @@ char *makemailcommand(char *mailcommand, char *email, char *id, char *subject)
12261230
free(newcmd2);
12271231

12281232
/* put subject */
1229-
if (strlen(subject)>0){
1233+
if (subject && strlen(subject)>0){
12301234
newcmd2 = replace(newcmd, "$SUBJECT", convsubj);
12311235
}else{
12321236
newcmd2 = replace(newcmd, "$SUBJECT", "");

0 commit comments

Comments
 (0)