Pulled in from nmh. Thanks to David Levine.
fmt_compile(char *fstring, struct format **fmt)
{
register char *cp;
- int i;
+ size_t i;
if (format_string)
free(format_string);
ljust++;
}
- if (!ljust && i > 0 && strlen(str) > i)
+ if (!ljust && i > 0 && (int)strlen(str) > i)
str[i] = '\0';
xp = str;
xp += strlen(str) - 1;
while (xp > str && isspace(*xp))
*xp-- = '\0';
- if (ljust && i > 0 && strlen(str) > i)
+ if (ljust && i > 0 && (int)strlen(str) > i)
str += strlen(str) - i;
}
break;
return BADNUM;
}
- for (bp = buf; isalpha(*cp) && (bp - buf < sizeof(buf) - 1); ) {
+ for (bp = buf; isalpha(*cp) && (bp - buf < (int)sizeof(buf) - 1); ) {
*bp++ = *cp++;
}
*bp++ = '\0';
if (cp)
fprintf(fp, "%s: ", cp);
fprintf(fp, "signal %d", signum);
- if (signum >= 0 && signum < sizeof(sigmsg) && sigmsg[signum] != NULL)
+ if (signum >= 0 && signum < (int)sizeof(sigmsg) &&
+ sigmsg[signum] != NULL)
fprintf(fp, " (%s%s)\n", sigmsg[signum],
WCOREDUMP(status) ? ", core dumped" : "");
else
int
seq_addsel(struct msgs *mp, char *cp, int public, int zero)
{
- int i, msgnum, new_seq = 1;
+ unsigned int i;
+ int msgnum, new_seq = 1;
if (!seq_nameok(cp))
return 0;
int
seq_addmsg(struct msgs *mp, char *cp, int msgnum, int public, int zero)
{
- int i, j, new_seq = 1;
+ unsigned int i;
+ int j, new_seq = 1;
if (!seq_nameok(cp))
return 0;
int
seq_delsel(struct msgs *mp, char *cp, int public, int zero)
{
- int i, msgnum, new_seq = 1;
+ unsigned int i;
+ int msgnum, new_seq = 1;
if (!seq_nameok(cp))
return 0;
static int
seq_init(struct msgs *mp, char *name, char *field)
{
- int i, j, k, is_current;
+ unsigned int i;
+ int j, k, is_current;
char *cp, **ap;
/*
** The only place where there might be problems.
** This assumes that ALL usernames are kept in lowercase.
*/
- for (c = name, c1 = lname; *c && (c1 - lname < sizeof(lname) - 1);
+ for (c = name, c1 = lname; *c && (c1 - lname < (int)sizeof(lname) - 1);
c++, c1++) {
if (isalpha(*c) && isupper(*c))
*c1 = tolower(*c);
int length;
int n; /* number of bytes written */
- mode = fstat(fd, &st) != NOTOK ? (st.st_mode & 0777) : m_gmprot();
+ mode = fstat(fd, &st) != NOTOK ? (int)(st.st_mode & 0777) : m_gmprot();
strncpy(tmpfil, m_mktemp2(file, "annotate", NULL, &tmp),
sizeof(tmpfil));
adios(msgnam, "unable to read message");
mode = fstat(fileno(in), &st) != NOTOK ?
- (st.st_mode & 0777) : m_gmprot();
+ (int)(st.st_mode & 0777) : m_gmprot();
mp = *mpp;
/*
if ((out = creat(drft, m_gmprot())) == NOTOK) {
adios(drft, "unable to create");
}
- if (write(out, fmtstr, strlen(fmtstr)) != strlen(fmtstr)) {
+ if (write(out, fmtstr, strlen(fmtstr)) != (int)strlen(fmtstr)) {
adios(drft, "error writing");
}
close(out);
adios(drft, "unable to create");
fmtstr = new_fs(form, distcomps);
- if (write(out, fmtstr, strlen(fmtstr)) != strlen(fmtstr)) {
+ if (write(out, fmtstr, strlen(fmtstr)) != (int)strlen(fmtstr)) {
adios(drft, "error writing");
}
close(out);
if (i != 0 && strncmp(buffer, "From ", 5) == 0) {
write(to, ">", 1);
}
- if (write(to, buffer, strlen(buffer)) != strlen(buffer)) {
+ if (write(to, buffer, strlen(buffer)) != (int)strlen(buffer)) {
fclose(fp);
return NOTOK;
}
static int nOrders = 0;
static int nOrdersAlloced = 0;
static struct Folder *folders = NULL;
-static int nFolders = 0;
+static unsigned int nFolders = 0;
static int nFoldersAlloced = 0;
/* info on folders to search */
/* info on sequences to search for */
static char *sequencesToDo[NUMATTRS];
-static int numsequences;
+static unsigned int numsequences;
static int all = FALSE; /* scan all folders in top level? */
static int alphaOrder = FALSE; /* want alphabetical order only */
int
AddFolder(char *name, int force)
{
- int i, msgnum, nonzero;
+ unsigned int i;
+ int msgnum, nonzero;
int seqnum[NUMATTRS], nSeq[NUMATTRS];
struct Folder *f;
struct msgs *mp;
PrintFolders(void)
{
char tmpname[BUFSIZ];
- int i, j, len, has_private = 0;
- int maxfolderlen = 0, maxseqlen = 0;
+ unsigned int i, j, len, has_private = 0;
+ unsigned int maxfolderlen = 0, maxseqlen = 0;
int maxnum = 0, maxseq = 0;
if (!Total) {
close(in);
} else {
fmtstr = new_fs(form, forwcomps);
- if (write(out, fmtstr, strlen(fmtstr)) != strlen(fmtstr)) {
+ if (write(out, fmtstr, strlen(fmtstr)) != (int)strlen(fmtstr)) {
adios(drft, "error writing");
}
}
main(int argc, char **argv)
{
int addsw = 0, deletesw = 0, debugsw = 0;
- int listsw = 0, publicsw = -1, zerosw = 0;
- int seqp = 0, msgnum;
+ int listsw = 0, publicsw = -1, zerosw = 0, msgnum;
+ unsigned int seqp = 0;
char *cp, *maildir, *folder = NULL, buf[BUFSIZ];
char **argp, **arguments;
char *seqs[NUMATTRS + 1];
#define NOTTY 0
static int ontty = NOTTY;
-static int column;
+static unsigned int column;
static int lm;
static int ovoff;
static int term;
-static int wid;
+static unsigned int wid;
static char *ovtxt;
count = 0;
if (cchdr) {
if (flag == TWOCOMP)
- count = (c1->c_cwidth >= 0) ?
- c1->c_cwidth : strlen(c2->c_name) + 2;
+ count = (c1->c_cwidth >= 0) ? c1->c_cwidth :
+ (int)strlen(c2->c_name) + 2;
else
- count = (c1->c_cwidth >= 0) ?
- c1->c_cwidth : strlen(c1->c_text ?
+ count = (c1->c_cwidth >= 0) ? (size_t)c1->c_cwidth :
+ strlen(c1->c_text ?
c1->c_text : c1->c_name) + 2;
}
count += c1->c_offset;
main(int argc, char **argv)
{
pid_t child_id;
- int status, i, iscc = 0, nvec;
+ int status, iscc = 0, nvec;
+ unsigned int i;
int queued = 0, resent = 0, somebody;
char *cp, *tolist = NULL, *cclist = NULL, *subject = NULL;
char *from = NULL, *body = NULL, **argp, **arguments;
int
writeBase64aux(FILE *in, FILE *out)
{
- int cc, n;
+ unsigned int cc, n;
char inbuf[3];
n = BPERLIN;
}
}
- if (buflen <= 0 || (ct->c_termproc && buflen <= strlen(ct->c_termproc))) {
+ if (buflen <= 0 || (ct->c_termproc &&
+ (size_t)buflen <= strlen(ct->c_termproc))) {
/*
** content_error would provide a more useful error message
** here, except that if we got overrun, it probably would
}
}
- if (buflen <= 0 ||
- (ct->c_termproc && buflen <= strlen(ct->c_termproc))) {
+ if (buflen <= 0 || (ct->c_termproc &&
+ (size_t)buflen <= strlen(ct->c_termproc))) {
/*
** content_error would provide a more useful error message
** here, except that if we got overrun, it probably would
int
main(int argc, char **argv)
{
- int publicsw = -1, zerosw = 1, seqp = 0, vecp = 0;
+ int publicsw = -1, zerosw = 1, vecp = 0;
+ unsigned int seqp = 0;
int lo, hi, msgnum;
char *maildir, *folder = NULL, buf[100];
char *cp, **argp, **arguments;
{
int publicsw = -1, zerosw = 0;
int create = 1, unseensw = 1;
- int fd, msgnum, seqp = 0;
+ int fd, msgnum;
+ size_t seqp = 0;
char *cp, *maildir, *folder = NULL, buf[BUFSIZ];
char **argp, **arguments, *seqs[NUMATTRS+1];
struct msgs *mp;
int nmsgs;
char *subjsort = NULL; /* sort on subject if != 0 */
-unsigned long datelimit = 0;
+time_t datelimit = 0;
int submajor = 0; /* if true, sort on subject-major */
int verbose;