summaryrefslogtreecommitdiff
path: root/usr.bin/mail
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2011-04-06 11:36:27 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2011-04-06 11:36:27 +0000
commite2ddf551fe54f5fd63dbb0131d6835d07f172753 (patch)
treeee263115c37260360e628dc4fc5e029d18e30311 /usr.bin/mail
parentecdee9dbaa69f9aa6f959777e5e515c31bb6a0f8 (diff)
Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0'
for chars.
Diffstat (limited to 'usr.bin/mail')
-rw-r--r--usr.bin/mail/cmd1.c4
-rw-r--r--usr.bin/mail/cmd2.c22
-rw-r--r--usr.bin/mail/cmd3.c10
-rw-r--r--usr.bin/mail/collect.c4
-rw-r--r--usr.bin/mail/lex.c6
5 files changed, 23 insertions, 23 deletions
diff --git a/usr.bin/mail/cmd1.c b/usr.bin/mail/cmd1.c
index c9a411330b1..bcc29f63fc8 100644
--- a/usr.bin/mail/cmd1.c
+++ b/usr.bin/mail/cmd1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd1.c,v 1.28 2009/10/27 23:59:40 deraadt Exp $ */
+/* $OpenBSD: cmd1.c,v 1.29 2011/04/06 11:36:26 miod Exp $ */
/* $NetBSD: cmd1.c,v 1.9 1997/07/09 05:29:48 mikel Exp $ */
/*-
@@ -166,7 +166,7 @@ from(void *v)
int *msgvec = v;
int *ip;
- for (ip = msgvec; *ip != NULL; ip++)
+ for (ip = msgvec; *ip != 0; ip++)
printhead(*ip);
if (--ip >= msgvec)
dot = &message[*ip - 1];
diff --git a/usr.bin/mail/cmd2.c b/usr.bin/mail/cmd2.c
index eb2c921440a..40944212eef 100644
--- a/usr.bin/mail/cmd2.c
+++ b/usr.bin/mail/cmd2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd2.c,v 1.17 2009/10/27 23:59:40 deraadt Exp $ */
+/* $OpenBSD: cmd2.c,v 1.18 2011/04/06 11:36:26 miod Exp $ */
/* $NetBSD: cmd2.c,v 1.7 1997/05/17 19:55:10 pk Exp $ */
/*
@@ -53,7 +53,7 @@ next(void *v)
int *msgvec = v;
int *ip, *ip2, list[2], mdot;
- if (*msgvec != NULL) {
+ if (*msgvec != 0) {
/*
* If some messages were supplied, find the
* first applicable one following dot using
@@ -65,7 +65,7 @@ next(void *v)
* Find the first message in the supplied
* message list which follows dot.
*/
- for (ip = msgvec; *ip != NULL; ip++)
+ for (ip = msgvec; *ip != 0; ip++)
if (*ip > mdot)
break;
if (*ip == 0)
@@ -77,7 +77,7 @@ next(void *v)
dot = mp;
goto hitit;
}
- if (*ip2 != NULL)
+ if (*ip2 != 0)
ip2++;
if (*ip2 == 0)
ip2 = msgvec;
@@ -110,7 +110,7 @@ hitit:
* Print dot.
*/
list[0] = dot - &message[0] + 1;
- list[1] = NULL;
+ list[1] = 0;
return(type(list));
}
@@ -158,7 +158,7 @@ save1(char *str, int mark, char *cmd, struct ignoretab *ignore)
printf("No messages to %s.\n", cmd);
return(1);
}
- msgvec[1] = NULL;
+ msgvec[1] = 0;
}
if (f && getmsglist(str, msgvec, 0) < 0)
return(1);
@@ -271,7 +271,7 @@ deltype(void *v)
list[0] = dot - &message[0] + 1;
if (list[0] > lastdot) {
touch(dot);
- list[1] = NULL;
+ list[1] = 0;
return(type(list));
}
puts("At EOF");
@@ -291,18 +291,18 @@ delm(int *msgvec)
struct message *mp;
int *ip, last;
- last = NULL;
- for (ip = msgvec; *ip != NULL; ip++) {
+ last = 0;
+ for (ip = msgvec; *ip != 0; ip++) {
mp = &message[*ip - 1];
touch(mp);
mp->m_flag |= MDELETED|MTOUCH;
mp->m_flag &= ~(MPRESERVE|MSAVED|MBOX);
last = *ip;
}
- if (last != NULL) {
+ if (last != 0) {
dot = &message[last-1];
last = first(0, MDELETED);
- if (last != NULL) {
+ if (last != 0) {
dot = &message[last-1];
return(0);
}
diff --git a/usr.bin/mail/cmd3.c b/usr.bin/mail/cmd3.c
index bce23b10939..905144b839d 100644
--- a/usr.bin/mail/cmd3.c
+++ b/usr.bin/mail/cmd3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd3.c,v 1.24 2009/10/27 23:59:40 deraadt Exp $ */
+/* $OpenBSD: cmd3.c,v 1.25 2011/04/06 11:36:26 miod Exp $ */
/* $NetBSD: cmd3.c,v 1.8 1997/07/09 05:29:49 mikel Exp $ */
/*
@@ -276,7 +276,7 @@ marknew(void *v)
int *msgvec = v;
int *ip;
- for (ip = msgvec; *ip != NULL; ip++) {
+ for (ip = msgvec; *ip != 0; ip++) {
dot = &message[*ip-1];
dot->m_flag &= ~(MBOX|MREAD|MTOUCH);
dot->m_flag |= MNEW|MSTATUS;
@@ -299,7 +299,7 @@ preserve(void *v)
puts("Cannot \"preserve\" in edit mode");
return(1);
}
- for (ip = msgvec; *ip != NULL; ip++) {
+ for (ip = msgvec; *ip != 0; ip++) {
mesg = *ip;
mp = &message[mesg-1];
mp->m_flag |= MPRESERVE;
@@ -318,7 +318,7 @@ unread(void *v)
int *msgvec = v;
int *ip;
- for (ip = msgvec; *ip != NULL; ip++) {
+ for (ip = msgvec; *ip != 0; ip++) {
dot = &message[*ip-1];
dot->m_flag &= ~(MREAD|MTOUCH);
dot->m_flag |= MSTATUS;
@@ -336,7 +336,7 @@ messize(void *v)
struct message *mp;
int *ip, mesg;
- for (ip = msgvec; *ip != NULL; ip++) {
+ for (ip = msgvec; *ip != 0; ip++) {
mesg = *ip;
mp = &message[mesg-1];
printf("%d: %d/%d\n", mesg, mp->m_lines, mp->m_size);
diff --git a/usr.bin/mail/collect.c b/usr.bin/mail/collect.c
index 63672bce745..204dc3606da 100644
--- a/usr.bin/mail/collect.c
+++ b/usr.bin/mail/collect.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: collect.c,v 1.32 2009/10/27 23:59:40 deraadt Exp $ */
+/* $OpenBSD: collect.c,v 1.33 2011/04/06 11:36:26 miod Exp $ */
/* $NetBSD: collect.c,v 1.9 1997/07/09 05:25:45 mikel Exp $ */
/*
@@ -523,7 +523,7 @@ forward(char *ms, FILE *fp, char *fn, int f)
puts("No appropriate messages");
return(0);
}
- msgvec[1] = NULL;
+ msgvec[1] = 0;
}
if (tolower(f) == 'f')
tabst = NULL;
diff --git a/usr.bin/mail/lex.c b/usr.bin/mail/lex.c
index 712d79df5b5..7690ce78330 100644
--- a/usr.bin/mail/lex.c
+++ b/usr.bin/mail/lex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lex.c,v 1.33 2009/10/27 23:59:40 deraadt Exp $ */
+/* $OpenBSD: lex.c,v 1.34 2011/04/06 11:36:26 miod Exp $ */
/* $NetBSD: lex.c,v 1.10 1997/05/17 19:55:13 pk Exp $ */
/*
@@ -397,7 +397,7 @@ execute(char *linebuf, int contxt)
if (c == 0) {
*msgvec = first(com->c_msgflag,
com->c_msgmask);
- msgvec[1] = NULL;
+ msgvec[1] = 0;
}
if (*msgvec == 0) {
puts("No applicable messages");
@@ -427,7 +427,7 @@ execute(char *linebuf, int contxt)
if (c == 0) {
*msgvec = first(com->c_msgflag,
com->c_msgmask);
- msgvec[1] = NULL;
+ msgvec[1] = 0;
}
if (*msgvec == 0) {
puts("No applicable messages");