projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Drop register storage class
[mmh]
/
uip
/
ap.c
diff --git
a/uip/ap.c
b/uip/ap.c
index
c293a53
..
acf3cac
100644
(file)
--- a/
uip/ap.c
+++ b/
uip/ap.c
@@
-9,6
+9,8
@@
#include <h/mh.h>
#include <h/addrsbr.h>
#include <h/fmt_scan.h>
#include <h/mh.h>
#include <h/addrsbr.h>
#include <h/fmt_scan.h>
+#include <locale.h>
+#include <sysexits.h>
#define NADDRS 100
#define NADDRS 100
@@
-61,22
+63,22
@@
main(int argc, char **argv)
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
switch (smatch(++cp, switches)) {
case AMBIGSW:
ambigsw(cp, switches);
- done(1);
+ exit(EX_USAGE);
case UNKWNSW:
case UNKWNSW:
- adios(NULL, "-%s unknown", cp);
+ adios(EX_USAGE, NULL, "-%s unknown", cp);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [switches] addrs ...", invo_name);
print_help(buf, switches, 1);
case HELPSW:
snprintf(buf, sizeof(buf), "%s [switches] addrs ...", invo_name);
print_help(buf, switches, 1);
- done(1);
+ exit(argc == 2 ? EX_OK : EX_USAGE);
case VERSIONSW:
print_version(invo_name);
case VERSIONSW:
print_version(invo_name);
- done(1);
+ exit(argc == 2 ? EX_OK : EX_USAGE);
case FORMSW:
if (!(form = *argp++) || *form == '-')
case FORMSW:
if (!(form = *argp++) || *form == '-')
- adios(NULL, "missing argument to %s", argp[-2]);
+ adios(EX_USAGE, NULL, "missing argument to %s", argp[-2]);
continue;
case NORMSW:
continue;
case NORMSW:
@@
-88,14
+90,14
@@
main(int argc, char **argv)
}
}
if (addrp > NADDRS)
}
}
if (addrp > NADDRS)
- adios(NULL, "more than %d addresses", NADDRS);
+ adios(EX_USAGE, NULL, "more than %d addresses", NADDRS);
else
addrs[addrp++] = cp;
}
addrs[addrp] = NULL;
if (addrp == 0)
else
addrs[addrp++] = cp;
}
addrs[addrp] = NULL;
if (addrp == 0)
- adios(NULL, "usage: %s [switches] addrs ...", invo_name);
+ adios(EX_USAGE, NULL, "usage: %s [switches] addrs ...", invo_name);
/* get new format string */
fmtstr = new_fs(form, FORMAT);
/* get new format string */
fmtstr = new_fs(form, FORMAT);
@@
-112,8
+114,7
@@
main(int argc, char **argv)
for (addrp = 0; addrs[addrp]; addrp++)
status += process(addrs[addrp], normalize);
for (addrp = 0; addrs[addrp]; addrp++)
status += process(addrs[addrp], normalize);
- done(status);
- return 1;
+ return status;
}
struct pqpair {
}
struct pqpair {
@@
-127,18
+128,18
@@
static int
process(char *arg, int norm)
{
int status = 0;
process(char *arg, int norm)
{
int status = 0;
- register char *cp;
+ char *cp;
char buffer[BUFSIZ + 1], error[BUFSIZ];
char buffer[BUFSIZ + 1], error[BUFSIZ];
- register struct comp *cptr;
- register struct pqpair *p, *q;
+ struct comp *cptr;
+ struct pqpair *p, *q;
struct pqpair pq;
struct pqpair pq;
- register struct mailname *mp;
+ struct mailname *mp;
(q = &pq)->pq_next = NULL;
while ((cp = getname(arg))) {
if ((p = (struct pqpair *)
calloc((size_t) 1, sizeof(*p))) == NULL)
(q = &pq)->pq_next = NULL;
while ((cp = getname(arg))) {
if ((p = (struct pqpair *)
calloc((size_t) 1, sizeof(*p))) == NULL)
- adios(NULL, "unable to allocate pqpair memory");
+ adios(EX_OSERR, NULL, "unable to allocate pqpair memory");
if ((mp = getm(cp, NULL, 0, norm, error)) == NULL) {
p->pq_text = getcpy(cp);
p->pq_error = getcpy(error);
if ((mp = getm(cp, NULL, 0, norm, error)) == NULL) {
p->pq_text = getcpy(cp);
p->pq_error = getcpy(error);