char **r;
struct host *h;
- for (p = name, q = site; *p && (q - site < sizeof(site) - 1); p++, q++)
+ for (p = name, q = site; *p && (q - site < (int)sizeof(site) - 1); p++, q++)
*q = isupper (*p) ? tolower (*p) : *p;
*q = '\0';
q = site;
"%s%s", username, extension);
if (snprintf_return < 0 ||
- snprintf_return >= sizeof(username_with_extension))
+ snprintf_return >= (int) sizeof(username_with_extension))
adios(NULL, "snprintf() error writing username (%d chars) and"
" $USERNAME_EXTENSION (%d chars) to array of BUFSIZ (%d)"
" chars",
snprintf_return = snprintf (addr, sizeof(addr), "%s@%s", username, domain);
- if (snprintf_return < 0 || snprintf_return >= sizeof(addr))
+ if (snprintf_return < 0 || snprintf_return >= (int) sizeof(addr))
adios(NULL, "snprintf() error writing username (%d chars), domain (%d"
" chars), and 1 separator char to array of BUFSIZ (%d) chars",
strlen(username), strlen(domain), BUFSIZ);
&& n1 == n2) {
c1 = b1;
c2 = b2;
- for (i = n1 < sizeof(b1) ? n1 : sizeof(b1); i--;)
+ for (i = n1 < (int) sizeof(b1) ? n1 : (int) sizeof(b1); i--;)
if (*c1++ != *c2++) {
resp = 0;
goto leave;
}
- if (n1 < sizeof(b1))
+ if (n1 < (int) sizeof(b1))
goto leave;
}
resp = 0;
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;
#ifdef LOCALE
/* doesn't enforce lower case */
for (bp = buf; (isalpha(*cp) || *cp == '.')
- && (bp - buf < sizeof(buf) - 1); )
+ && (bp - buf < (int) sizeof(buf) - 1); )
#else
for (bp = buf; ((*cp >= 'a' && *cp <= 'z') || *cp == '.')
- && (bp - buf < sizeof(buf) - 1); )
+ && (bp - buf < (int) sizeof(buf) - 1); )
#endif /* LOCALE */
{
*bp++ = *cp++;
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;
/*
Everyone = EVERYONE;
for (hm = homehead; hm; hm = hm->h_next)
- if (hm->h_uid > Everyone
+ if ((int) hm->h_uid > Everyone
&& (noshell || strcmp (hm->h_shell, NoShell)))
add_aka (ak, hm->h_name);
* 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); c++, c1++) {
+ for (c = name, c1 = lname;
+ *c && (c1 - lname < (int) sizeof(lname) - 1);
+ c++, c1++) {
if (isalpha(*c) && isupper(*c))
*c1 = tolower (*c);
else
int length; /* length of field name */
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));
chmod (tmpfil, mode);
if ((in = fopen (msgnam = m_name (msgnum), "r")) == NULL)
adios (msgnam, "unable to read message");
- mode = fstat (fileno(in), &st) != NOTOK ? (st.st_mode & 0777) : m_gmprot();
+ mode =
+ fstat (fileno(in), &st) != NOTOK ? (int) (st.st_mode & 0777) : m_gmprot();
mp = *mpp;
/*
static int
mbx_chk_mmdf (int fd)
{
- size_t count;
+ ssize_t count;
char ldelim[BUFSIZ];
count = strlen (mmdlm2);
- /* casting -count to off_t, seem to break FreeBSD 2.2.6 */
- if (lseek (fd, (long) (-count), SEEK_END) == (off_t) NOTOK)
+ if (lseek (fd, -count, SEEK_END) == (off_t) NOTOK)
return NOTOK;
if (read (fd, ldelim, count) != count)
return NOTOK;
memcpy((char *) dp, (char *) mp, sizeof(*dp));
lseek (md, (off_t) sizeof(*mp), SEEK_SET);
- if ((i = read (md, (char *) (dp + 1), msgp * sizeof(*dp))) < sizeof(*dp)) {
+ if ((i = read (md, (char *) (dp + 1), msgp * sizeof(*dp))) <
+ (int) sizeof(*dp)) {
i = 0;
free ((char *) dp);
} else {
mode_t mode;
struct stat st;
- mode = fstat (md, &st) != NOTOK ? (mode_t) (st.st_mode & 0777) : m_gmprot ();
+ mode = fstat (md, &st) != NOTOK ? (int) (st.st_mode & 0777) : m_gmprot ();
return mbx_open (file, OTHER_FORMAT, st.st_uid, st.st_gid, mode);
}
int
map_chk (char *file, int fd, struct drop *dp, long pos, int noisy)
{
- long count;
+ ssize_t count;
struct drop d, tmpd;
register struct drop *dl;
}
dl = &d;
- count = (long) strlen (mmdlm2);
+ count = strlen (mmdlm2);
lseek (fd, (off_t) (dp->d_id * sizeof(*dp)), SEEK_SET);
if (read (fd, (char *) dl, sizeof(*dl)) != sizeof(*dl)
|| (ntohl(dl->d_stop) != dp->d_stop
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) {
* handle about 995 messages (because vec is fixed size),
* but that should be plenty.
*/
- for (msgnum = mp->lowsel; msgnum <= mp->hghsel && i < sizeof(vec) - 1;
- msgnum++)
+ for (msgnum = mp->lowsel;
+ msgnum <= mp->hghsel && i < (int) sizeof(vec) - 1;
+ msgnum++)
if (is_selected (mp, msgnum))
vec[i++] = getcpy (m_name (msgnum));
vec[i] = NULL;
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];
static int ontty = NOTTY;
static int row;
-static int column;
+static unsigned int column;
static int lm;
static int llim;
static int ovoff;
static int term;
-static int wid;
+static unsigned int wid;
static char *ovtxt;
if (cchdr) {
if (flag == TWOCOMP)
count = (c1->c_cwidth >= 0) ? c1->c_cwidth
- : strlen (c2->c_name) + 2;
+ : (int) strlen (c2->c_name) + 2;
else
- count = (c1->c_cwidth >= 0) ? c1->c_cwidth
+ 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;
+ size_t 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
* too.
}
}
- 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
* too.
markcmd (char **args)
{
int addsw = 0, deletesw = 0, debugsw = 0;
- int listsw = 0, zerosw = 0, seqp = 0;
+ int listsw = 0, zerosw = 0;
+ size_t seqp = 0;
int msgp = 0, msgnum;
char *cp, buf[BUFSIZ];
char *seqs[NUMATTRS + 1], *msgs[MAXARGS];
void
pickcmd (char **args)
{
- int zerosw = 1, msgp = 0, seqp = 0;
+ int zerosw = 1, msgp = 0;
+ size_t seqp = 0;
int vecp = 0, hi, lo, msgnum;
char *cp, buf[BUFSIZ], *msgs[MAXARGS];
char *seqs[NUMATTRS], *vec[MAXARGS];
int
main (int argc, char **argv)
{
- int publicsw = -1, zerosw = 1, seqp = 0, vecp = 0;
+ int publicsw = -1, zerosw = 1, vecp = 0;
+ size_t 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 = (char *) 0; /* sort on subject if != 0 */
-unsigned long datelimit = 0;
+time_t datelimit = 0;
int submajor = 0; /* if true, sort on subject-major */
int verbose;