summaryrefslogtreecommitdiffstats
path: root/usr.bin/mail
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-12-19 21:50:22 +0000
committerache <ache@FreeBSD.org>2001-12-19 21:50:22 +0000
commit8d59503ab28990d5f3e683cef1f40660c7b50508 (patch)
treea101958a87607acd1ecdfdaf29ad688ec4ed0209 /usr.bin/mail
parent551ea08f0f87088f86af940cfa8a858ab92dddf3 (diff)
downloadFreeBSD-src-8d59503ab28990d5f3e683cef1f40660c7b50508.zip
FreeBSD-src-8d59503ab28990d5f3e683cef1f40660c7b50508.tar.gz
Add (unsigned char) cast to ctype macros
ftell->ftello, fseek->fseeko File 'newsize' type int->off_t Add visible (long) cast to fsize() when it called to small one message file and result is assigned to long.
Diffstat (limited to 'usr.bin/mail')
-rw-r--r--usr.bin/mail/aux.c4
-rw-r--r--usr.bin/mail/cmd2.c6
-rw-r--r--usr.bin/mail/collect.c8
-rw-r--r--usr.bin/mail/edit.c2
-rw-r--r--usr.bin/mail/fio.c12
-rw-r--r--usr.bin/mail/head.c12
-rw-r--r--usr.bin/mail/lex.c10
-rw-r--r--usr.bin/mail/list.c10
-rw-r--r--usr.bin/mail/send.c4
9 files changed, 34 insertions, 34 deletions
diff --git a/usr.bin/mail/aux.c b/usr.bin/mail/aux.c
index 4db5b85..2f735b1 100644
--- a/usr.bin/mail/aux.c
+++ b/usr.bin/mail/aux.c
@@ -181,7 +181,7 @@ gethfield(f, linebuf, rem, colon)
return (-1);
if ((c = readline(f, linebuf, LINESIZE)) <= 0)
return (-1);
- for (cp = linebuf; isprint(*cp) && *cp != ' ' && *cp != ':';
+ for (cp = linebuf; isprint((unsigned char)*cp) && *cp != ' ' && *cp != ':';
cp++)
;
if (*cp != ':' || cp == linebuf)
@@ -256,7 +256,7 @@ istrncpy(dest, src, dsize)
strlcpy(dest, src, dsize);
while (*dest)
- *dest++ = tolower(*dest);
+ *dest++ = tolower((unsigned char)*dest);
}
/*
diff --git a/usr.bin/mail/cmd2.c b/usr.bin/mail/cmd2.c
index 5ab6b85..b25af30 100644
--- a/usr.bin/mail/cmd2.c
+++ b/usr.bin/mail/cmd2.c
@@ -249,7 +249,7 @@ snarf(linebuf, flag)
* Strip away trailing blanks.
*/
- while (cp > linebuf && isspace(*cp))
+ while (cp > linebuf && isspace((unsigned char)*cp))
cp--;
*++cp = '\0';
@@ -257,13 +257,13 @@ snarf(linebuf, flag)
* Now search for the beginning of the file name.
*/
- while (cp > linebuf && !isspace(*cp))
+ while (cp > linebuf && !isspace((unsigned char)*cp))
cp--;
if (*cp == '\0') {
printf("No file specified.\n");
return (NULL);
}
- if (isspace(*cp))
+ if (isspace((unsigned char)*cp))
*cp++ = '\0';
else
*flag = 0;
diff --git a/usr.bin/mail/collect.c b/usr.bin/mail/collect.c
index 4c42c90..6fc7493 100644
--- a/usr.bin/mail/collect.c
+++ b/usr.bin/mail/collect.c
@@ -248,7 +248,7 @@ cont:
* Set the Subject line.
*/
cp = &linebuf[2];
- while (isspace(*cp))
+ while (isspace((unsigned char)*cp))
cp++;
hp->h_subject = savestr(cp);
break;
@@ -257,7 +257,7 @@ cont:
* Set the Reply-To line.
*/
cp = &linebuf[2];
- while (isspace(*cp))
+ while (isspace((unsigned char)*cp))
cp++;
hp->h_replyto = savestr(cp);
break;
@@ -287,7 +287,7 @@ cont:
* then open it and copy the contents to collf.
*/
cp = &linebuf[2];
- while (isspace(*cp))
+ while (isspace((unsigned char)*cp))
cp++;
if (*cp == '\0') {
printf("Interpolate what file?\n");
@@ -563,7 +563,7 @@ forward(ms, fp, fn, f)
tabst = NULL;
else if ((tabst = value("indentprefix")) == NULL)
tabst = "\t";
- ig = isupper(f) ? NULL : ignore;
+ ig = isupper((unsigned char)f) ? NULL : ignore;
printf("Interpolating:");
for (; *msgvec != 0; msgvec++) {
struct message *mp = message + *msgvec - 1;
diff --git a/usr.bin/mail/edit.c b/usr.bin/mail/edit.c
index e8d54de..8e5e14a 100644
--- a/usr.bin/mail/edit.c
+++ b/usr.bin/mail/edit.c
@@ -115,7 +115,7 @@ edit1(msgvec, type)
size = ftello(otf);
mp->m_block = blockof(size);
mp->m_offset = boffsetof(size);
- mp->m_size = fsize(fp);
+ mp->m_size = (long)fsize(fp);
mp->m_lines = 0;
mp->m_flag |= MODIFY;
rewind(fp);
diff --git a/usr.bin/mail/fio.c b/usr.bin/mail/fio.c
index 0c78e3e..a10021b 100644
--- a/usr.bin/mail/fio.c
+++ b/usr.bin/mail/fio.c
@@ -82,15 +82,15 @@ setptr(ibuf, offset)
msgCount = 0;
} else {
/* Seek into the file to get to the new messages */
- (void)fseek(ibuf, offset, SEEK_SET);
+ (void)fseeko(ibuf, offset, SEEK_SET);
/*
* We need to make "offset" a pointer to the end of
* the temp file that has the copy of the mail file.
* If any messages have been edited, this will be
* different from the offset into the mail file.
*/
- (void)fseek(otf, 0L, SEEK_END);
- offset = ftell(otf);
+ (void)fseeko(otf, (off_t)0, SEEK_END);
+ offset = ftello(otf);
}
omsgCount = msgCount;
maybe = 1;
@@ -138,7 +138,7 @@ setptr(ibuf, offset)
} else if (inhead) {
for (cp = linebuf, cp2 = "status";; cp++) {
if ((c = *cp2++) == '\0') {
- while (isspace(*cp++))
+ while (isspace((unsigned char)*cp++))
;
if (cp[-1] != ':')
break;
@@ -150,7 +150,7 @@ setptr(ibuf, offset)
inhead = 0;
break;
}
- if (*cp != c && *cp != toupper(c))
+ if (*cp != c && *cp != toupper((unsigned char)c))
break;
}
}
@@ -221,7 +221,7 @@ setinput(mp)
(void)fflush(otf);
if (fseeko(itf,
positionof(mp->m_block, mp->m_offset), SEEK_SET) < 0)
- err(1, "fseek");
+ err(1, "fseeko");
return (itf);
}
diff --git a/usr.bin/mail/head.c b/usr.bin/mail/head.c
index 806ab6d..61f43da 100644
--- a/usr.bin/mail/head.c
+++ b/usr.bin/mail/head.c
@@ -204,11 +204,11 @@ cmatch(cp, tp)
while (*cp != '\0' && *tp != '\0')
switch (*tp++) {
case 'a':
- if (!islower(*cp++))
+ if (!islower((unsigned char)*cp++))
return (0);
break;
case 'A':
- if (!isupper(*cp++))
+ if (!isupper((unsigned char)*cp++))
return (0);
break;
case ' ':
@@ -216,20 +216,20 @@ cmatch(cp, tp)
return (0);
break;
case '0':
- if (!isdigit(*cp++))
+ if (!isdigit((unsigned char)*cp++))
return (0);
break;
case 'O':
- if (*cp != ' ' && !isdigit(*cp))
+ if (*cp != ' ' && !isdigit((unsigned char)*cp))
return (0);
cp++;
break;
case 'p':
- if (!ispunct(*cp++))
+ if (!ispunct((unsigned char)*cp++))
return (0);
break;
case 'P':
- if (*cp != ' ' && !ispunct(*cp))
+ if (*cp != ' ' && !ispunct((unsigned char)*cp))
return (0);
cp++;
break;
diff --git a/usr.bin/mail/lex.c b/usr.bin/mail/lex.c
index c7f674c..46255b8 100644
--- a/usr.bin/mail/lex.c
+++ b/usr.bin/mail/lex.c
@@ -143,7 +143,7 @@ setfile(name)
* the mail file, so reset mailsize to be where
* we really are in the file...
*/
- mailsize = ftell(ibuf);
+ mailsize = ftello(ibuf);
(void)Fclose(ibuf);
relsesigs();
sawcom = 0;
@@ -162,7 +162,7 @@ nomail:
int
incfile()
{
- int newsize;
+ off_t newsize;
int omsgCount = msgCount;
FILE *ibuf;
@@ -179,7 +179,7 @@ incfile()
return (0); /* no new mail */
setptr(ibuf, mailsize);
setmsize(msgCount);
- mailsize = ftell(ibuf);
+ mailsize = ftello(ibuf);
(void)Fclose(ibuf);
relsesigs();
return (msgCount - omsgCount);
@@ -290,7 +290,7 @@ execute(linebuf, contxt)
* lexical conventions.
*/
- for (cp = linebuf; isspace(*cp); cp++)
+ for (cp = linebuf; isspace((unsigned char)*cp); cp++)
;
if (*cp == '!') {
if (sourcing) {
@@ -398,7 +398,7 @@ execute(linebuf, contxt)
* Just the straight string, with
* leading blanks removed.
*/
- while (isspace(*cp))
+ while (isspace((unsigned char)*cp))
cp++;
e = (*com->c_func)(cp);
break;
diff --git a/usr.bin/mail/list.c b/usr.bin/mail/list.c
index 1dbc587..be5df83 100644
--- a/usr.bin/mail/list.c
+++ b/usr.bin/mail/list.c
@@ -555,9 +555,9 @@ scan(sp)
* Return TNUMBER when done.
*/
- if (isdigit(c)) {
+ if (isdigit((unsigned char)c)) {
lexnumber = 0;
- while (isdigit(c)) {
+ while (isdigit((unsigned char)c)) {
lexnumber = lexnumber*10 + c - '0';
*cp2++ = c;
c = *cp++;
@@ -678,7 +678,7 @@ matchsender(str, mesg)
while (*cp2 != '\0') {
if (*cp == '\0')
return (1);
- if (toupper(*cp++) != toupper(*cp2++)) {
+ if (toupper((unsigned char)*cp++) != toupper((unsigned char)*cp2++)) {
cp2 = ++backup;
cp = str;
}
@@ -717,7 +717,7 @@ matchto(str, mesg)
while (*cp2 != '\0') {
if (*cp == '\0')
return (1);
- if (toupper(*cp++) != toupper(*cp2++)) {
+ if (toupper((unsigned char)*cp++) != toupper((unsigned char)*cp2++)) {
cp2 = ++backup;
cp = str;
}
@@ -775,7 +775,7 @@ matchsubj(str, mesg)
while (*cp2 != '\0') {
if (*cp == '\0')
return (1);
- if (toupper(*cp++) != toupper(*cp2++)) {
+ if (toupper((unsigned char)*cp++) != toupper((unsigned char)*cp2++)) {
cp2 = ++backup;
cp = str;
}
diff --git a/usr.bin/mail/send.c b/usr.bin/mail/send.c
index 58f029a..7351cc5 100644
--- a/usr.bin/mail/send.c
+++ b/usr.bin/mail/send.c
@@ -123,10 +123,10 @@ sendmessage(mp, obuf, doign, prefix)
* Pick up the header field if we have one.
*/
for (cp = line; (c = *cp++) != '\0' && c != ':' &&
- !isspace(c);)
+ !isspace((unsigned char)c);)
;
cp2 = --cp;
- while (isspace(*cp++))
+ while (isspace((unsigned char)*cp++))
;
if (cp[-1] != ':') {
/*
OpenPOWER on IntegriCloud