From: Ralph Corderoy Date: Mon, 30 Oct 2017 20:29:29 +0000 (+0000) Subject: Replace adios(NULL, ...) with die(...). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/00d760f7506c2d5c32ab5abf9f11b3066999f08a?hp=eed1bea439a5e3c62958fa1e524d527c4a2fb85d Replace adios(NULL, ...) with die(...). It's the common case, and saves having to skip over the NULL when reading, and avoids the risk of the format string being passed as the first parameter by mistake. --- diff --git a/sbr/arglist.c b/sbr/arglist.c index 026da19e..5ede1fa1 100644 --- a/sbr/arglist.c +++ b/sbr/arglist.c @@ -75,12 +75,12 @@ argsplit(char *command, char **file, int *argp) p = mh_xstrdup(command); split = brkstring(p, " \t", NULL); if (split[0] == NULL) { - adios(NULL, "Invalid blank command found"); + die("Invalid blank command found"); } argvarray[0] = mh_xstrdup(r1bindex(split[0], '/')); for (i = 1; split[i] != NULL; i++) { if (i > MAXARGS) { - adios(NULL, "Command exceeded argument limit"); + die("Command exceeded argument limit"); } argvarray[i] = mh_xstrdup(split[i]); } diff --git a/sbr/context_read.c b/sbr/context_read.c index f899624e..def50969 100644 --- a/sbr/context_read.c +++ b/sbr/context_read.c @@ -53,7 +53,7 @@ context_read (void) if ((mypath = getenv("HOME")) == NULL) { if ((pw = getpwuid(getuid())) == NULL || *pw->pw_dir == '\0') - adios(NULL, "cannot determine your home directory"); + die("cannot determine your home directory"); mypath = pw->pw_dir; } @@ -70,16 +70,16 @@ context_read (void) /* defpath is an absolute path; make sure that always MH is, too. */ setenv("MH", defpath, 1); if (stat(defpath, &st) != -1 && (st.st_mode & S_IFREG) == 0) - adios(NULL, "`%s' specified by your MH environment variable is not a normal file", cp); + die("`%s' specified by your MH environment variable is not a normal file", cp); if ((ib = fopen(defpath, "r")) == NULL) - adios(NULL, "unable to read the `%s' profile specified by your MH environment variable", defpath); + die("unable to read the `%s' profile specified by your MH environment variable", defpath); } else { defpath = concat(mypath, "/", mh_profile, NULL); if ((ib = fopen(defpath, "r")) == NULL) - adios(NULL, "Doesn't look like nmh is installed. Run install-mh to do so."); + die("Doesn't look like nmh is installed. Run install-mh to do so."); cp = mh_profile; } @@ -93,10 +93,10 @@ context_read (void) */ if ((cp = context_find ("path")) == NULL) - adios(NULL, "Your %s file does not contain a path entry.", defpath); + die("Your %s file does not contain a path entry.", defpath); if (*cp == '\0') - adios(NULL, "Your `%s' profile file does not contain a valid path entry.", defpath); + die("Your `%s' profile file does not contain a valid path entry.", defpath); if (*cp != '/') (void)snprintf (nd = buf, sizeof(buf), "%s/%s", mypath, cp); @@ -110,16 +110,16 @@ context_read (void) cp = concat ("Your MH-directory \"", nd, "\" doesn't exist; Create it? ", NULL); if (!read_yes_or_no_if_tty(cp)) - adios (NULL, "unable to access MH-directory \"%s\"", nd); + die("unable to access MH-directory \"%s\"", nd); free (cp); if (!makedir (nd)) - adios (NULL, "unable to create %s", nd); + die("unable to create %s", nd); } else if ((st.st_mode & S_IFDIR) == 0) - adios (NULL, "`%s' is not a directory", nd); + die("`%s' is not a directory", nd); /* * Open and read user's context file. The name of the context file comes from the diff --git a/sbr/fmt_compile.c b/sbr/fmt_compile.c index 2ad46cf5..bea76e6c 100644 --- a/sbr/fmt_compile.c +++ b/sbr/fmt_compile.c @@ -376,7 +376,7 @@ compile_error(char *str, char *cp) inform("\"%s\": format compile error - %s", &usr_fstring[errpos-errctx], str); - adios (NULL, "%*s", errctx+1, "^"); + die("%*s", errctx+1, "^"); } /* diff --git a/sbr/fmt_scan.c b/sbr/fmt_scan.c index 791146a2..61269b34 100644 --- a/sbr/fmt_scan.c +++ b/sbr/fmt_scan.c @@ -497,7 +497,7 @@ fmt_scan (struct format *format, charstring_t scanlp, int width, int *dat, if (str) charstring_push_back_chars (scanlp, str, strlen (str), 0); break; case FT_STRFW: - adios (NULL, "internal error (FT_STRFW)"); + die("internal error (FT_STRFW)"); case FT_NUM: { int num = value; @@ -1029,7 +1029,7 @@ fmt_scan (struct format *format, charstring_t scanlp, int width, int *dat, indent = strlen (sp); wid -= indent; if (wid <= 0) { - adios(NULL, "putaddr -- num register (%d) must be greater " + die("putaddr -- num register (%d) must be greater " "than label width (%d)", value, indent); } while ((c = *sp++) && charstring_chars (scanlp) < max) { diff --git a/sbr/folder_delmsgs.c b/sbr/folder_delmsgs.c index 9addf7cc..43eb0ad3 100644 --- a/sbr/folder_delmsgs.c +++ b/sbr/folder_delmsgs.c @@ -60,7 +60,7 @@ folder_delmsgs (struct msgs *mp, int unlink_msgs, int nohook) for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) { if (is_selected (mp, msgnum) && !(vec[vecp++] = strdup (m_name (msgnum)))) - adios (NULL, "strdup failed"); + die("strdup failed"); } vec[vecp] = NULL; @@ -132,7 +132,7 @@ folder_delmsgs (struct msgs *mp, int unlink_msgs, int nohook) /* Sanity check */ if (mp->numsel != 0) - adios (NULL, "oops, mp->numsel should be 0"); + die("oops, mp->numsel should be 0"); /* Mark that the sequence information has changed */ mp->msgflags |= SEQMOD; diff --git a/sbr/folder_read.c b/sbr/folder_read.c index 1129bab0..3b1c63bd 100644 --- a/sbr/folder_read.c +++ b/sbr/folder_read.c @@ -127,7 +127,7 @@ folder_read (char *name, int lockflag) */ if (mp->hghoff < mp->lowoff) { - adios(NULL, "Internal failure: high message limit < low message " + die("Internal failure: high message limit < low message " "limit; possible overflow?"); } diff --git a/sbr/folder_realloc.c b/sbr/folder_realloc.c index 8ed95e2e..8eb2fcce 100644 --- a/sbr/folder_realloc.c +++ b/sbr/folder_realloc.c @@ -25,14 +25,14 @@ folder_realloc (struct msgs *mp, int lo, int hi) /* sanity checks */ if (lo < 1) - adios (NULL, "BUG: called folder_realloc with lo (%d) < 1", lo); + die("BUG: called folder_realloc with lo (%d) < 1", lo); if (hi < 1) - adios (NULL, "BUG: called folder_realloc with hi (%d) < 1", hi); + die("BUG: called folder_realloc with hi (%d) < 1", hi); if (mp->nummsg > 0 && lo > mp->lowmsg) - adios (NULL, "BUG: called folder_realloc with lo (%d) > mp->lowmsg (%d)", + die("BUG: called folder_realloc with lo (%d) > mp->lowmsg (%d)", lo, mp->lowmsg); if (mp->nummsg > 0 && hi < mp->hghmsg) - adios (NULL, "BUG: called folder_realloc with hi (%d) < mp->hghmsg (%d)", + die("BUG: called folder_realloc with hi (%d) < mp->hghmsg (%d)", hi, mp->hghmsg); /* Check if we really need to reallocate anything */ diff --git a/sbr/lock_file.c b/sbr/lock_file.c index 2c8b1c75..b1f31b68 100644 --- a/sbr/lock_file.c +++ b/sbr/lock_file.c @@ -314,7 +314,7 @@ lkopen (const char *file, int access, mode_t mode, enum locktype ltype, #endif /* HAVE_FLOCK */ default: - adios(NULL, "Internal locking error: unsupported lock type used!"); + die("Internal locking error: unsupported lock type used!"); } return -1; @@ -750,20 +750,20 @@ init_locktype(const char *lockname) #ifdef HAVE_LOCKF return LOCKF_LOCKING; #else /* ! HAVE_LOCKF */ - adios(NULL, "lockf not supported on this system"); + die("lockf not supported on this system"); #endif /* HAVE_LOCKF */ } if (strcasecmp(lockname, "flock") == 0) { #ifdef HAVE_FLOCK return FLOCK_LOCKING; #else /* ! HAVE_FLOCK */ - adios(NULL, "flock not supported on this system"); + die("flock not supported on this system"); #endif /* HAVE_FLOCK */ } if (strcasecmp(lockname, "dot") == 0) { return DOT_LOCKING; } - adios(NULL, "Unknown lock type: \"%s\"", lockname); + die("Unknown lock type: \"%s\"", lockname); /* NOTREACHED */ return 0; } diff --git a/sbr/m_draft.c b/sbr/m_draft.c index ebf7ef7e..8bfb8397 100644 --- a/sbr/m_draft.c +++ b/sbr/m_draft.c @@ -41,7 +41,7 @@ m_draft (char *folder, char *msg, int use, int *isdf) adios (buffer, "unable to change directory to"); if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* * Make sure we have enough message status space for all @@ -51,10 +51,10 @@ m_draft (char *folder, char *msg, int use, int *isdf) */ if (mp->hghmsg >= mp->hghoff) { if (!(mp = folder_realloc (mp, 1, mp->hghmsg + 10))) - adios (NULL, "unable to allocate folder storage"); + die("unable to allocate folder storage"); } else if (mp->lowoff > 1) { if (!(mp = folder_realloc (mp, 1, mp->hghoff))) - adios (NULL, "unable to allocate folder storage"); + die("unable to allocate folder storage"); } mp->msgflags |= ALLOW_NEW; /* allow the "new" sequence */ @@ -69,7 +69,7 @@ m_draft (char *folder, char *msg, int use, int *isdf) seq_setprev (mp); if (mp->numsel > 1) - adios (NULL, "only one message draft at a time!"); + die("only one message draft at a time!"); snprintf (buffer, sizeof(buffer), "%s/%s", mp->foldpath, m_name (mp->lowsel)); cp = buffer; diff --git a/sbr/m_getfld.c b/sbr/m_getfld.c index a8377bf7..bebcf1b4 100644 --- a/sbr/m_getfld.c +++ b/sbr/m_getfld.c @@ -353,7 +353,7 @@ m_getfld_track_filepos (m_getfld_state_t *gstate, FILE *iob) { void m_getfld_track_filepos2(m_getfld_state_t *gstate) { if (!*gstate) - adios(NULL, "m_getfld_track_filepos2 without gstate"); + die("m_getfld_track_filepos2 without gstate"); m_getfld_track_filepos(gstate, (*gstate)->iob); } @@ -547,7 +547,7 @@ static void Ungetc(m_getfld_state_t s) { if (s->readpos == s->msg_buf) - adios(NULL, "Ungetc() at start of message buffer."); + die("Ungetc() at start of message buffer."); s->readpos--; s->bytes_read--; @@ -833,7 +833,7 @@ m_getfld (m_getfld_state_t *gstate, char name[NAMESZ], char *buf, int *bufsz, } default: - adios (NULL, "m_getfld() called with bogus state of %d", s->state); + die("m_getfld() called with bogus state of %d", s->state); } *cp = 0; @@ -847,7 +847,7 @@ m_getfld (m_getfld_state_t *gstate, char name[NAMESZ], char *buf, int *bufsz, int m_getfld2(m_getfld_state_t *gstate, char name[NAMESZ], char *buf, int *bufsz) { if (!*gstate) - adios(NULL, "m_getfld2 without gstate"); + die("m_getfld2 without gstate"); return m_getfld(gstate, name, buf, bufsz, (*gstate)->iob); } @@ -918,7 +918,7 @@ m_unknown(m_getfld_state_t *gstate, FILE *iob) s->edelimlen = c - 1; s->delimend = s->msg_delim + s->edelimlen; if (s->edelimlen <= 1) - adios (NULL, "maildrop delimiter must be at least 2 bytes"); + die("maildrop delimiter must be at least 2 bytes"); /* * build a Boyer-Moore end-position map for the matcher in m_getfld. @@ -947,7 +947,7 @@ m_unknown(m_getfld_state_t *gstate, FILE *iob) void m_unknown2(m_getfld_state_t *gstate) { if (!*gstate) - adios(NULL, "m_unknown2 without gstate"); + die("m_unknown2 without gstate"); m_unknown(gstate, (*gstate)->iob); } diff --git a/sbr/mts.c b/sbr/mts.c index f6180b03..4a056755 100644 --- a/sbr/mts.c +++ b/sbr/mts.c @@ -117,7 +117,7 @@ save_mts_method (const char *value) { mts_method = "sendmail/pipe"; sm_mts = MTS_SENDMAIL_PIPE; } else { - adios (NULL, "unsupported mts selection \"%s\"", value); + die("unsupported mts selection \"%s\"", value); } } diff --git a/sbr/oauth.c b/sbr/oauth.c index aac6b43a..d2abf2f2 100755 --- a/sbr/oauth.c +++ b/sbr/oauth.c @@ -141,7 +141,7 @@ mh_oauth_do_xoauth(const char *user, const char *svc, unsigned char **oauth_res, char *client_res; if (!mh_oauth_new (&ctx, svc)) - adios(NULL, "%s", mh_oauth_get_err_string(ctx)); + die("%s", mh_oauth_get_err_string(ctx)); if (log != NULL) mh_oauth_log_to(stderr, ctx); @@ -149,7 +149,7 @@ mh_oauth_do_xoauth(const char *user, const char *svc, unsigned char **oauth_res, fp = lkfopendata(fn, "r+", &failed_to_lock); if (fp == NULL) { if (errno == ENOENT) { - adios(NULL, "no credentials -- run mhlogin -saslmech xoauth2 -authservice %s", svc); + die("no credentials -- run mhlogin -saslmech xoauth2 -authservice %s", svc); } adios(fn, "failed to open"); } @@ -158,24 +158,24 @@ mh_oauth_do_xoauth(const char *user, const char *svc, unsigned char **oauth_res, } if ((cred = mh_oauth_cred_load(fp, ctx, user)) == NULL) { - adios(NULL, "%s", mh_oauth_get_err_string(ctx)); + die("%s", mh_oauth_get_err_string(ctx)); } if (!mh_oauth_access_token_valid(time(NULL), cred)) { if (!mh_oauth_refresh(cred)) { if (mh_oauth_get_err_code(ctx) == MH_OAUTH_NO_REFRESH) { - adios(NULL, "no valid credentials -- run mhlogin -saslmech xoauth2 -authservice %s", svc); + die("no valid credentials -- run mhlogin -saslmech xoauth2 -authservice %s", svc); } if (mh_oauth_get_err_code(ctx) == MH_OAUTH_BAD_GRANT) { - adios(NULL, "credentials rejected -- run mhlogin -saslmech xoauth2 -authservice %s", svc); + die("credentials rejected -- run mhlogin -saslmech xoauth2 -authservice %s", svc); } inform("error refreshing OAuth2 token"); - adios(NULL, "%s", mh_oauth_get_err_string(ctx)); + die("%s", mh_oauth_get_err_string(ctx)); } fseek(fp, 0, SEEK_SET); if (!mh_oauth_cred_save(fp, cred, user)) { - adios(NULL, "%s", mh_oauth_get_err_string(ctx)); + die("%s", mh_oauth_get_err_string(ctx)); } } diff --git a/sbr/readconfig.c b/sbr/readconfig.c index 5b51a610..1bbc069c 100644 --- a/sbr/readconfig.c +++ b/sbr/readconfig.c @@ -90,13 +90,13 @@ readconfig (struct node **npp, FILE *ib, const char *file, int ctx) continue; case BODY: - adios (NULL, "no blank lines are permitted in %s", file); + die("no blank lines are permitted in %s", file); case FILEEOF: break; default: - adios (NULL, "%s is poorly formatted", file); + die("%s is poorly formatted", file); } break; } diff --git a/sbr/ruserpass.c b/sbr/ruserpass.c index 5c47aa11..513fb117 100644 --- a/sbr/ruserpass.c +++ b/sbr/ruserpass.c @@ -110,7 +110,7 @@ ruserpass(const char *host, char **aname, char **apass, int flags) user to correct it. */ inform("group or other permissions, %#o, " "forbidden: %s", stb.st_mode, credentials_file); - adios(NULL, "Remove password or correct file " + die("Remove password or correct file " "permissions."); } if (token(tokval) && *apass == 0) @@ -210,7 +210,7 @@ token(char *tokval) *cp++ = c; if (cp - tokval > MAX_TOKVAL_SIZE-1) { - adios(NULL, "credential tokens restricted to length %d", + die("credential tokens restricted to length %d", MAX_TOKVAL_SIZE - 1); } } diff --git a/sbr/seq_read.c b/sbr/seq_read.c index 39192605..9a4b9131 100644 --- a/sbr/seq_read.c +++ b/sbr/seq_read.c @@ -103,7 +103,7 @@ seq_public (struct msgs *mp, int lockflag, int *failed_to_lock) case BODY: lkfclosedata (fp, seqfile); - adios (NULL, "no blank lines are permitted in %s", seqfile); + die("no blank lines are permitted in %s", seqfile); break; case FILEEOF: @@ -111,7 +111,7 @@ seq_public (struct msgs *mp, int lockflag, int *failed_to_lock) default: lkfclosedata (fp, seqfile); - adios (NULL, "%s is poorly formatted", seqfile); + die("%s is poorly formatted", seqfile); } break; /* break from for loop */ } diff --git a/sbr/utils.c b/sbr/utils.c index dd875325..839670b5 100644 --- a/sbr/utils.c +++ b/sbr/utils.c @@ -36,7 +36,7 @@ void *mh_xmalloc(size_t size) size = 1; /* Some mallocs don't like 0. */ p = malloc(size); if (!p) - adios(NULL, "malloc failed, size wanted: %zu", size); + die("malloc failed, size wanted: %zu", size); return p; } @@ -56,7 +56,7 @@ void *mh_xrealloc(void *ptr, size_t size) new = realloc(ptr, size); if (!new) - adios(NULL, "realloc failed, size wanted: %zu", size); + die("realloc failed, size wanted: %zu", size); return new; } @@ -71,7 +71,7 @@ void *mh_xcalloc(size_t nelem, size_t elsize) p = calloc(nelem, elsize); if (!p) - adios(NULL, "calloc failed, size wanted: %zu * %zu", nelem, elsize); + die("calloc failed, size wanted: %zu * %zu", nelem, elsize); return p; } @@ -205,7 +205,7 @@ void create_folder(char *folder, int autocreate, void (*done_callback)(int)) done_callback (1); } if (!makedir (folder)) - adios (NULL, "unable to create folder %s", folder); + die("unable to create folder %s", folder); } } @@ -220,7 +220,7 @@ num_digits (int n) /* Sanity check */ if (n < 0) - adios (NULL, "oops, num_digits called with negative value"); + die("oops, num_digits called with negative value"); if (n == 0) return 1; diff --git a/sbr/vfgets.c b/sbr/vfgets.c index d3946bc6..d21c797a 100644 --- a/sbr/vfgets.c +++ b/sbr/vfgets.c @@ -34,7 +34,7 @@ vfgets (FILE *in, char **bp) if ((dp = cp + strlen (cp) - 2) < cp || *dp != QUOTE) { wrong_guess: if (cp > ++dp) - adios (NULL, "vfgets() botch -- you lose big"); + die("vfgets() botch -- you lose big"); if (*dp == '\n') { *bp = pp; return 0; diff --git a/uip/ali.c b/uip/ali.c index f4e46648..760a26f8 100644 --- a/uip/ali.c +++ b/uip/ali.c @@ -66,7 +66,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] aliases ...", @@ -79,9 +79,9 @@ main (int argc, char **argv) case ALIASW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if ((i = alias (cp)) != AK_OK) - adios (NULL, "aliasing error in %s - %s", cp, akerror (i)); + die("aliasing error in %s - %s", cp, akerror (i)); continue; case NALIASW: noalias = true; @@ -108,7 +108,7 @@ main (int argc, char **argv) } else { /* Should never happen, but try to protect against code changes that could allow it. */ - adios (NULL, "too many arguments"); + die("too many arguments"); } } @@ -119,7 +119,7 @@ main (int argc, char **argv) for (ap = brkstring(dp = mh_xstrdup(cp), " ", "\n"); ap && *ap; ap++) if ((i = alias (*ap)) != AK_OK) - adios (NULL, "aliasing error in %s - %s", *ap, akerror (i)); + die("aliasing error in %s - %s", *ap, akerror (i)); free(dp); } alias (AliasFile); @@ -130,7 +130,7 @@ main (int argc, char **argv) */ if (inverted) { if (vecp == 0) - adios (NULL, "usage: %s -user addresses ... (you forgot the addresses)", + die("usage: %s -user addresses ... (you forgot the addresses)", invo_name); for (i = 0; i < vecp; i++) @@ -207,9 +207,9 @@ print_usr (char *s, bool list) struct mailname *mp, *np; if ((pp = getname (s)) == NULL) - adios (NULL, "no address in \"%s\"", s); + die("no address in \"%s\"", s); if ((mp = getm (pp, NULL, 0, NULL, 0)) == NULL) - adios (NULL, "bad address \"%s\"", s); + die("bad address \"%s\"", s); while (getname ("")) continue; diff --git a/uip/anno.c b/uip/anno.c index 2335ada0..56935c24 100644 --- a/uip/anno.c +++ b/uip/anno.c @@ -108,7 +108,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", @@ -121,9 +121,9 @@ main (int argc, char **argv) case COMPSW: if (comp) - adios (NULL, "only one component at a time!"); + die("only one component at a time!"); if (!(comp = *argp++) || *comp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case DATESW: @@ -142,9 +142,9 @@ main (int argc, char **argv) case TEXTSW: if (text) - adios (NULL, "only one body at a time!"); + die("only one body at a time!"); if (!(text = *argp++) || *text == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case DELETESW: /* delete annotations */ @@ -161,7 +161,7 @@ main (int argc, char **argv) case NUMBERSW: /* number listing or delete by number */ if (number != 0) - adios (NULL, "only one number at a time!"); + die("only one number at a time!"); if (argp - arguments == argc - 1 || **argp == '-') number = 1; @@ -171,7 +171,7 @@ main (int argc, char **argv) number = -1; else if (!(number = atoi(*argp))) - adios (NULL, "missing argument to %s", argp[-1]); + die("missing argument to %s", argp[-1]); argp++; } @@ -194,7 +194,7 @@ main (int argc, char **argv) } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else app_msgarg(&msgs, cp); @@ -208,7 +208,7 @@ main (int argc, char **argv) if (draft != NULL) { if (msgs.size != 0) - adios(NULL, "can only have message numbers or -draft."); + die("can only have message numbers or -draft."); draft = mh_xstrdup(m_draft(folder, NULL, 1, &isdf)); @@ -236,11 +236,11 @@ main (int argc, char **argv) /* read folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) @@ -285,13 +285,13 @@ make_comp (char **ap) if ((cp = *ap + strlen (*ap) - 1) > *ap && *cp == ':') *cp = 0; if (!**ap) - adios (NULL, "null component name"); + die("null component name"); if (**ap == '-') - adios (NULL, "invalid component name %s", *ap); + die("invalid component name %s", *ap); if (strlen (*ap) >= NAMESZ) - adios (NULL, "too large component name %s", *ap); + die("too large component name %s", *ap); for (cp = *ap; *cp; cp++) if (!isalnum ((unsigned char) *cp) && *cp != '-') - adios (NULL, "invalid component name %s", *ap); + die("invalid component name %s", *ap); } diff --git a/uip/annosbr.c b/uip/annosbr.c index cadfa637..c5ca38bf 100644 --- a/uip/annosbr.c +++ b/uip/annosbr.c @@ -186,7 +186,7 @@ annosbr (int fd, char *file, char *comp, char *text, bool inplace, bool datesw, mode = fstat (fd, &st) != NOTOK ? (int) (st.st_mode & 0777) : m_gmprot (); if ((cp = m_mktemp2(file, "annotate", NULL, &tmp)) == NULL) { - adios(NULL, "unable to create temporary file"); + die("unable to create temporary file"); } strncpy (tmpfil, cp, sizeof(tmpfil)); chmod (tmpfil, mode); @@ -201,7 +201,7 @@ annosbr (int fd, char *file, char *comp, char *text, bool inplace, bool datesw, if (delete >= -1 || append) { if ((fp = fdopen(fd, "r")) == NULL) - adios(NULL, "unable to fdopen file."); + die("unable to fdopen file."); field = mh_xmalloc(field_size = 256); } @@ -324,7 +324,7 @@ annosbr (int fd, char *file, char *comp, char *text, bool inplace, bool datesw, */ if ((n = fputs(field, tmp)) == EOF || (c == '\n' && fputc('\n', tmp) == EOF)) - adios(NULL, "unable to write temporary file."); + die("unable to write temporary file."); } while (*field != '\0' && *field != '-'); @@ -393,7 +393,7 @@ annosbr (int fd, char *file, char *comp, char *text, bool inplace, bool datesw, */ if (fp && lseek(fd, (off_t)ftell(fp), SEEK_SET) == (off_t)-1) - adios(NULL, "can't seek."); + die("can't seek."); cpydata (fd, fileno (tmp), file, tmpfil); fclose (tmp); diff --git a/uip/ap.c b/uip/ap.c index 0e3e8b55..fbcf62b0 100644 --- a/uip/ap.c +++ b/uip/ap.c @@ -66,7 +66,7 @@ main (int argc, char **argv) done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] addrs ...", @@ -79,30 +79,30 @@ main (int argc, char **argv) case FORMSW: if (!(form = *argp++) || *form == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); format = NULL; continue; case FMTSW: if (!(format = *argp++) || *format == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); form = NULL; continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); width = atoi (cp); continue; } } if (addrp == NADDRS) - adios (NULL, "more than %d addresses", NADDRS); + die("more than %d addresses", NADDRS); addrs[addrp++] = cp; } addrs[addrp] = NULL; if (addrp == 0) - adios (NULL, "usage: %s [switches] addrs ...", invo_name); + die("usage: %s [switches] addrs ...", invo_name); /* get new format string */ nfs = new_fs (form, format, FORMAT); diff --git a/uip/burst.c b/uip/burst.c index 5e5d86b9..6bd96ea6 100644 --- a/uip/burst.c +++ b/uip/burst.c @@ -88,7 +88,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown\n", cp); + die("-%s unknown\n", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", @@ -133,7 +133,7 @@ main (int argc, char **argv) } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else { app_msgarg(&msgs, cp); @@ -153,11 +153,11 @@ main (int argc, char **argv) /* read folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) @@ -185,7 +185,7 @@ main (int argc, char **argv) msgnum); } /* this pair of braces was missing before 1999-07-15 */ else - adios (NULL, "burst() botch -- you lose big"); + die("burst() botch -- you lose big"); } } } @@ -384,7 +384,7 @@ burst (struct msgs **mpp, int msgnum, struct smsg *smsgs, int numburst, */ if ((mp->hghmsg + numburst > mp->hghoff) && !(mp = folder_realloc (mp, mp->lowoff, mp->hghmsg + numburst))) - adios (NULL, "unable to allocate folder storage"); + die("unable to allocate folder storage"); *mpp = mp; j = mp->hghmsg; /* old value */ @@ -455,7 +455,7 @@ burst (struct msgs **mpp, int msgnum, struct smsg *smsgs, int numburst, char *tempfile; if ((tempfile = m_mktemp2(NULL, invo_name, NULL, &out)) == NULL) { - adios(NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } strncpy (f2, tempfile, sizeof(f2)); diff --git a/uip/comp.c b/uip/comp.c index 2805d56b..3667f2e4 100644 --- a/uip/comp.c +++ b/uip/comp.c @@ -95,7 +95,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msg] [switches]", @@ -108,7 +108,7 @@ main (int argc, char **argv) case EDITRSW: if (!(ed = *argp++) || *ed == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); nedit = 0; continue; case NEDITSW: @@ -117,7 +117,7 @@ main (int argc, char **argv) case WHATSW: if (!(whatnowproc = *argp++) || *whatnowproc == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); nwhat = 0; continue; @@ -130,7 +130,7 @@ main (int argc, char **argv) case FORMSW: if (!(form = *argp++) || *form == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case USESW: @@ -142,25 +142,25 @@ main (int argc, char **argv) case FILESW: /* compatibility */ if (file) - adios (NULL, "only one file at a time!"); + die("only one file at a time!"); if (!(file = *argp++) || *file == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); isdf = NOTOK; continue; case DFOLDSW: if (dfolder) - adios (NULL, "only one draft folder at a time!"); + die("only one draft folder at a time!"); if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp, *cp != '@' ? TFOLDER : TSUBCWF); continue; case DMSGSW: if (file) - adios (NULL, "only one draft message at a time!"); + die("only one draft message at a time!"); if (!(file = *argp++) || *file == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case NDFLDSW: dfolder = NULL; @@ -169,25 +169,25 @@ main (int argc, char **argv) case TOSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); to = addlist(to, cp); continue; case CCSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); cc = addlist(cc, cp); continue; case FROMSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); from = addlist(from, cp); continue; case FCCSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); dp = NULL; if (*cp == '@') cp = dp = path(cp + 1, TSUBCWF); @@ -197,25 +197,25 @@ main (int argc, char **argv) case WIDTHSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if ((outputlinelen = atoi(cp)) < 10) - adios (NULL, "impossible width %d", outputlinelen); + die("impossible width %d", outputlinelen); continue; case SUBJECTSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); subject = cp; continue; } } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else { if (msg) - adios (NULL, "only one message at a time!"); + die("only one message at a time!"); msg = cp; } } @@ -234,7 +234,7 @@ main (int argc, char **argv) msg = NULL; } if (form && (folder || msg)) - adios (NULL, "can't mix forms and folders/msgs"); + die("can't mix forms and folders/msgs"); cp = NULL; @@ -253,11 +253,11 @@ main (int argc, char **argv) /* read folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse the message range/sequence/name and set SELECTED */ if (!m_convert (mp, msg)) @@ -266,7 +266,7 @@ main (int argc, char **argv) seq_save (mp); if (mp->numsel > 1) - adios (NULL, "only one message at a time!"); + die("only one message at a time!"); if ((in = open (form = mh_xstrdup(m_name (mp->lowsel)), O_RDONLY)) == NOTOK) adios (form, "unable to open message"); diff --git a/uip/dist.c b/uip/dist.c index 7eea4fcc..ad42e1f0 100644 --- a/uip/dist.c +++ b/uip/dist.c @@ -95,7 +95,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msg] [switches]", @@ -115,7 +115,7 @@ main (int argc, char **argv) case EDITRSW: if (!(ed = *argp++) || *ed == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); nedit = 0; continue; case NEDITSW: @@ -124,7 +124,7 @@ main (int argc, char **argv) case WHATSW: if (!(whatnowproc = *argp++) || *whatnowproc == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); nwhat = 0; continue; case NWHATSW: @@ -133,14 +133,14 @@ main (int argc, char **argv) case FILESW: if (file) - adios (NULL, "only one file at a time!"); + die("only one file at a time!"); if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); file = path (cp, TFILE); continue; case FORMSW: if (!(form = *argp++) || *form == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case INPLSW: @@ -152,17 +152,17 @@ main (int argc, char **argv) case DFOLDSW: if (dfolder) - adios (NULL, "only one draft folder at a time!"); + die("only one draft folder at a time!"); if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp, *cp != '@' ? TFOLDER : TSUBCWF); continue; case DMSGSW: if (dmsg) - adios (NULL, "only one draft message at a time!"); + die("only one draft message at a time!"); if (!(dmsg = *argp++) || *dmsg == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case NDFLDSW: dfolder = NULL; @@ -171,30 +171,30 @@ main (int argc, char **argv) case FROMSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); from = addlist(from, cp); continue; case TOSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); to = addlist(to, cp); continue; case CCSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); cc = addlist(cc, cp); continue; case FCCSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); fcc = addlist(fcc, cp); continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if ((outputlinelen = atoi(cp)) < 10) - adios (NULL, "impossible width %d", outputlinelen); + die("impossible width %d", outputlinelen); continue; case ATFILESW: @@ -207,11 +207,11 @@ main (int argc, char **argv) } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else { if (msg) - adios (NULL, "only one message at a time!"); + die("only one message at a time!"); msg = cp; } } @@ -221,7 +221,7 @@ main (int argc, char **argv) if (!context_find ("path")) free (path ("./", TFOLDER)); if (file && (msg || folder)) - adios (NULL, "can't mix files and folders/msgs"); + die("can't mix files and folders/msgs"); try_it_again: strncpy (drft, m_draft (dfolder, dmsg, NOUSE, &isdf), sizeof(drft)); @@ -275,11 +275,11 @@ try_it_again: /* read folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse the message range/sequence/name and set SELECTED */ if (!m_convert (mp, msg)) @@ -287,7 +287,7 @@ try_it_again: seq_setprev (mp); /* set the previous-sequence */ if (mp->numsel > 1) - adios (NULL, "only one message at a time!"); + die("only one message at a time!"); } msgnam = file ? file : mh_xstrdup(m_name (mp->lowsel)); diff --git a/uip/distsbr.c b/uip/distsbr.c index bf469c3e..64b8ae19 100644 --- a/uip/distsbr.c +++ b/uip/distsbr.c @@ -93,7 +93,7 @@ distout (char *drft, char *msgnam, char *backup) return NOTOK; default: - adios (NULL, "getfld() returned %d", state); + die("getfld() returned %d", state); } } process: ; @@ -145,12 +145,12 @@ ready_msg (char *msgnam) cp = m_mktemp2(NULL, "dist", &hdrfd, NULL); if (cp == NULL) { - adios(NULL, "unable to create temporary file in %s", get_temp_dir()); + die("unable to create temporary file in %s", get_temp_dir()); } strncpy(tmpfil, cp, sizeof(tmpfil)); if ((out = dup (hdrfd)) == NOTOK || (ofp = fdopen (out, "w")) == NULL) - adios (NULL, "no file descriptors -- you lose big"); + die("no file descriptors -- you lose big"); (void) m_unlink (tmpfil); gstate = m_getfld_state_init(ifp); @@ -174,14 +174,14 @@ ready_msg (char *msgnam) cp = m_mktemp2(NULL, "dist", &txtfd, NULL); if (cp == NULL) { - adios(NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } fchmod(txtfd, 0600); strncpy (tmpfil, cp, sizeof(tmpfil)); if ((out = dup (txtfd)) == NOTOK || (ofp = fdopen (out, "w")) == NULL) - adios (NULL, "no file descriptors -- you lose big"); + die("no file descriptors -- you lose big"); (void) m_unlink (tmpfil); fprintf (ofp, "\n%s", buffer); while (state == BODY) { @@ -194,10 +194,10 @@ ready_msg (char *msgnam) case LENERR: case FMTERR: - adios (NULL, "format error in message %s", msgnam); + die("format error in message %s", msgnam); default: - adios (NULL, "getfld() returned %d", state); + die("getfld() returned %d", state); } } process: ; diff --git a/uip/dp.c b/uip/dp.c index dc799910..c2bed42c 100644 --- a/uip/dp.c +++ b/uip/dp.c @@ -61,7 +61,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] dates ...", @@ -74,30 +74,30 @@ main (int argc, char **argv) case FORMSW: if (!(form = *argp++) || *form == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); format = NULL; continue; case FMTSW: if (!(format = *argp++) || *format == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); form = NULL; continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); width = atoi (cp); continue; } } if (datep == NDATES) - adios (NULL, "more than %d dates", NDATES); + die("more than %d dates", NDATES); dates[datep++] = cp; } dates[datep] = NULL; if (datep == 0) - adios (NULL, "usage: %s [switches] dates ...", invo_name); + die("usage: %s [switches] dates ...", invo_name); /* get new format string */ nfs = new_fs (form, format, FORMAT); diff --git a/uip/flist.c b/uip/flist.c index e3c84a43..99009ca3 100644 --- a/uip/flist.c +++ b/uip/flist.c @@ -140,7 +140,7 @@ main(int argc, char **argv) ambigsw(cp, switches); done(1); case UNKWNSW: - adios(NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf(buf, sizeof(buf), "%s [+folder1 [+folder2 ...]][switches]", @@ -153,7 +153,7 @@ main(int argc, char **argv) case SEQSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); svector_push_back (sequencesToDo, cp); break; @@ -237,7 +237,7 @@ main(int argc, char **argv) for (; ap && *ap; ap++) svector_push_back (sequencesToDo, *ap); } else { - adios (NULL, "no sequence specified or %s profile entry found", usequence); + die("no sequence specified or %s profile entry found", usequence); } } diff --git a/uip/fmtdump.c b/uip/fmtdump.c index 3fa0876a..abcffeff 100644 --- a/uip/fmtdump.c +++ b/uip/fmtdump.c @@ -63,7 +63,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches]", invo_name); @@ -75,19 +75,19 @@ main (int argc, char **argv) case FORMSW: if (!(form = *argp++) || *form == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); format = NULL; continue; case FMTSW: if (!(format = *argp++) || *format == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); form = NULL; continue; } } if (form) - adios (NULL, "only one form at a time!"); + die("only one form at a time!"); form = cp; } diff --git a/uip/fmttest.c b/uip/fmttest.c index d458bb6b..c5e9079c 100644 --- a/uip/fmttest.c +++ b/uip/fmttest.c @@ -136,11 +136,11 @@ main (int argc, char **argv) */ if (*++cp == '-') { if (*++cp == '\0') - adios(NULL, "missing component name after --"); + die("missing component name after --"); app_msgarg(&compargs, cp); /* Grab next argument for component text */ if (!(cp = *argp++)) - adios(NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); app_msgarg(&compargs, cp); continue; } @@ -149,7 +149,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches]", invo_name); @@ -159,12 +159,12 @@ main (int argc, char **argv) print_version(invo_name); done (0); case OTHERSW: - adios(NULL, "internal argument error!"); + die("internal argument error!"); continue; case OUTSIZESW: if (!(cp = *argp++) || *cp == '-') - adios(NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if (strcmp(cp, "max") == 0) outputsize = INT_MAX; else if (strcmp(cp, "width") == 0) @@ -175,12 +175,12 @@ main (int argc, char **argv) case FORMSW: if (!(form = *argp++) || *form == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); format = NULL; continue; case FMTSW: if (!(format = *argp++) || *format == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); form = NULL; continue; @@ -231,27 +231,27 @@ main (int argc, char **argv) case WIDTHSW: if (!(cp = *argp++) || *cp == '-') - adios(NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); colwidth = atoi(cp); continue; case MSGNUMSW: if (!(cp = *argp++) || *cp == '-') - adios(NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); msgnum = atoi(cp); continue; case MSGCURSW: if (!(cp = *argp++) || *cp == '-') - adios(NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); msgcur = atoi(cp); continue; case MSGSIZESW: if (!(cp = *argp++) || *cp == '-') - adios(NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); msgsize = atoi(cp); continue; case UNSEENSW: if (!(cp = *argp++) || *cp == '-') - adios(NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); msgunseen = atoi(cp); continue; @@ -271,7 +271,7 @@ main (int argc, char **argv) if (mode == MESSAGE && !files && (*cp == '+' || *cp == '@')) { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else app_msgarg(&msgs, cp); @@ -288,7 +288,7 @@ main (int argc, char **argv) */ if (!dump && compargs.size == 0 && msgs.size == 0) { - adios(NULL, "usage: [switches] [+folder] msgs | strings..."); + die("usage: [switches] [+folder] msgs | strings..."); } /* @@ -297,7 +297,7 @@ main (int argc, char **argv) */ if (mode == RAW && form == NULL && format == NULL) { - adios (NULL, "You must specify a format with -form or -format when " + die("You must specify a format with -form or -format when " "using -raw"); } @@ -501,10 +501,10 @@ process_messages(struct format *fmt, struct msgs_array *comps, adios(maildir, "unable to change directory to"); if (!(mp = folder_read(folder, 1))) - adios(NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); if (mp->nummsg == 0) - adios(NULL, "no messages in %s", folder); + die("no messages in %s", folder); for (i = 0; i < msgs->size; i++) if (!m_convert(mp, msgs->msgs[i])) diff --git a/uip/folder.c b/uip/folder.c index 3989a42c..2be44264 100644 --- a/uip/folder.c +++ b/uip/folder.c @@ -100,7 +100,7 @@ static void nonexistent_folder (int status) { NMH_UNUSED (status); - adios (NULL, "folder %s does not exist", folder); + die("folder %s does not exist", folder); } @@ -130,7 +130,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msg] [switches]", @@ -226,11 +226,11 @@ main (int argc, char **argv) } if (*cp == '+' || *cp == '@') { if (argfolder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); argfolder = pluspath (cp); } else { if (msg) - adios (NULL, "only one (current) message at a time!"); + die("only one (current) message at a time!"); msg = cp; } } @@ -256,7 +256,7 @@ main (int argc, char **argv) ap = brkstring (dp, " ", "\n"); argfolder = getcpy(*ap++); } else { - adios (NULL, "no other folder"); + die("no other folder"); } for (cp = mh_xstrdup(getfolder(1)); *ap; ap++) cp = add (*ap, add (" ", cp)); @@ -274,13 +274,13 @@ main (int argc, char **argv) /* Popping a folder off of the folder stack */ if (popsw) { if (argfolder) - adios (NULL, "sorry, no folders allowed with -pop"); + die("sorry, no folders allowed with -pop"); if ((cp = context_find (stack))) { dp = mh_xstrdup(cp); ap = brkstring (dp, " ", "\n"); argfolder = getcpy(*ap++); } else { - adios (NULL, "folder stack empty"); + die("folder stack empty"); } if (*ap) { /* if there's anything left in the stack */ diff --git a/uip/forw.c b/uip/forw.c index 6ec53be3..ac2f7652 100644 --- a/uip/forw.c +++ b/uip/forw.c @@ -130,7 +130,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", @@ -150,7 +150,7 @@ main (int argc, char **argv) case EDITRSW: if (!(ed = *argp++) || *ed == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); nedit = 0; continue; case NEDITSW: @@ -159,7 +159,7 @@ main (int argc, char **argv) case WHATSW: if (!(whatnowproc = *argp++) || *whatnowproc == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); nwhat = 0; continue; case BILDSW: @@ -171,20 +171,20 @@ main (int argc, char **argv) case FILESW: if (file) - adios (NULL, "only one file at a time!"); + die("only one file at a time!"); if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); file = path (cp, TFILE); continue; case FILTSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); filter = mh_xstrdup(etcpath(cp)); mime = 0; continue; case FORMSW: if (!(form = *argp++) || *form == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case FRMTSW: @@ -211,36 +211,36 @@ main (int argc, char **argv) case DGSTSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); digest = mh_xstrdup(cp); mime = 0; continue; case ISSUESW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if ((issue = atoi (cp)) < 1) - adios (NULL, "bad argument %s %s", argp[-2], cp); + die("bad argument %s %s", argp[-2], cp); continue; case VOLUMSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if ((volume = atoi (cp)) < 1) - adios (NULL, "bad argument %s %s", argp[-2], cp); + die("bad argument %s %s", argp[-2], cp); continue; case DFOLDSW: if (dfolder) - adios (NULL, "only one draft folder at a time!"); + die("only one draft folder at a time!"); if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp, *cp != '@' ? TFOLDER : TSUBCWF); continue; case DMSGSW: if (dmsg) - adios (NULL, "only one draft message at a time!"); + die("only one draft message at a time!"); if (!(dmsg = *argp++) || *dmsg == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case NDFLDSW: dfolder = NULL; @@ -256,41 +256,41 @@ main (int argc, char **argv) case FROMSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); from = addlist(from, cp); continue; case TOSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); to = addlist(to, cp); continue; case CCSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); cc = addlist(cc, cp); continue; case FCCSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); fcc = addlist(fcc, cp); continue; case SUBJECTSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); subject = mh_xstrdup(cp); continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if ((outputlinelen = atoi(cp)) < 10) - adios (NULL, "impossible width %d", outputlinelen); + die("impossible width %d", outputlinelen); continue; } } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else { app_msgarg(&msgs, cp); @@ -302,7 +302,7 @@ main (int argc, char **argv) if (!context_find ("path")) free (path ("./", TFOLDER)); if (file && (msgs.size || folder)) - adios (NULL, "can't mix files and folders/msgs"); + die("can't mix files and folders/msgs"); try_it_again: @@ -358,11 +358,11 @@ try_it_again: /* read folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) @@ -383,7 +383,7 @@ try_it_again: } if (! fwdmsg) - adios (NULL, "Unable to find input message"); + die("Unable to find input message"); } if (filter && access (filter, R_OK) == NOTOK) diff --git a/uip/forwsbr.c b/uip/forwsbr.c index 1ae630d5..b33b9905 100644 --- a/uip/forwsbr.c +++ b/uip/forwsbr.c @@ -121,7 +121,7 @@ build_form (char *form, char *digest, int *dat, char *from, char *to, goto finished; default: - adios(NULL, "m_getfld2() returned %d", state); + die("m_getfld2() returned %d", state); } } @@ -176,7 +176,7 @@ finished: cp = m_mktemp2(NULL, invo_name, NULL, &tmp); if (cp == NULL) { - adios(NULL, "unable to create temporary file in %s", get_temp_dir()); + die("unable to create temporary file in %s", get_temp_dir()); } strncpy (tmpfil, cp, sizeof(tmpfil)); (void) m_unlink (tmpfil); diff --git a/uip/imaptest.c b/uip/imaptest.c index 2032e671..c250c214 100644 --- a/uip/imaptest.c +++ b/uip/imaptest.c @@ -109,7 +109,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] +folder command " @@ -122,15 +122,15 @@ main (int argc, char **argv) case HOSTSW: if (!(host = *argp++) || *host == '-') - adios(NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case PORTSW: if (!(port = *argp++) || *port == '-') - adios(NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case USERSW: if (!(user = *argp++) || *user == '-') - adios(NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case SNOOPSW: @@ -147,11 +147,11 @@ main (int argc, char **argv) continue; case SASLMECHSW: if (!(saslmech = *argp++) || *saslmech == '-') - adios(NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case AUTHSERVICESW: if (!(oauth_svc = *argp++) || *oauth_svc == '-') - adios(NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case TLSSW: tls = true; @@ -174,7 +174,7 @@ main (int argc, char **argv) } } else if (*cp == '+') { if (*(cp + 1) == '\0') - adios(NULL, "Invalid null folder name"); + die("Invalid null folder name"); add_msg(0, "SELECT \"%s\"", cp + 1); } else { add_msg(0, "%s", cp); @@ -182,7 +182,7 @@ main (int argc, char **argv) } if (! host) - adios(NULL, "A hostname must be given with -host"); + die("A hostname must be given with -host"); nsc = netsec_init(); @@ -196,7 +196,7 @@ main (int argc, char **argv) if (oauth_svc) { if (netsec_set_oauth_service(nsc, oauth_svc) != OK) { - adios(NULL, "OAuth2 not supported"); + die("OAuth2 not supported"); } } @@ -204,7 +204,7 @@ main (int argc, char **argv) gettimeofday(&tv_start, NULL); if ((fd = client(host, port, buf, sizeof(buf), snoop)) == NOTOK) - adios(NULL, "Connect failed: %s", buf); + die("Connect failed: %s", buf); if (timestamp) { ts_report("Connect time", &tv_start); @@ -216,20 +216,20 @@ main (int argc, char **argv) if (initialtls || tls) { if (netsec_set_tls(nsc, 1, 0, &errstr) != OK) - adios(NULL, "%s", errstr); + die("%s", errstr); if (initialtls && netsec_negotiate_tls(nsc, &errstr) != OK) - adios(NULL, "%s", errstr); + die("%s", errstr); } if (sasl) { if (netsec_set_sasl_params(nsc, "imap", saslmech, imap_sasl_callback, nsc, &errstr) != OK) - adios(NULL, "%s", errstr); + die("%s", errstr); } if ((cp = netsec_readline(nsc, &len, &errstr)) == NULL) { - adios(NULL, "%s", errstr); + die("%s", errstr); } if (has_prefix(cp, "* BYE")) { @@ -295,7 +295,7 @@ main (int argc, char **argv) goto finish; } if (netsec_negotiate_tls(nsc, &errstr) != OK) { - adios(NULL, "%s", errstr); + die("%s", errstr); } } diff --git a/uip/inc.c b/uip/inc.c index 552d7932..6c49b3d8 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -236,7 +236,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [switches]", invo_name); @@ -248,7 +248,7 @@ main (int argc, char **argv) case AUDSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); audfile = mh_xstrdup(m_maildir(cp)); continue; case NAUDSW: @@ -278,7 +278,7 @@ main (int argc, char **argv) case FILESW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); from = path (cp, TFILE); /* @@ -298,34 +298,34 @@ main (int argc, char **argv) case FORMSW: if (!(form = *argp++) || *form == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); format = NULL; continue; case FMTSW: if (!(format = *argp++) || *format == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); form = NULL; continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); width = atoi (cp); continue; case HOSTSW: if (!(host = *argp++) || *host == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case PORTSW: if (!(port = *argp++) || *port == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case USERSW: if (!(user = *argp++) || *user == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case SNOOPSW: @@ -341,7 +341,7 @@ main (int argc, char **argv) case SASLMECHSW: if (!(saslmech = *argp++) || *saslmech == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case INITTLSSW: @@ -363,24 +363,24 @@ main (int argc, char **argv) case AUTHSERVICESW: #ifdef OAUTH_SUPPORT if (!(auth_svc = *argp++) || *auth_svc == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); #else - adios (NULL, "not built with OAuth support"); + die("not built with OAuth support"); #endif continue; case PROXYSW: if (!(proxy = *argp++) || *proxy == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; } } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else { - adios (NULL, "usage: %s [+folder] [switches]", invo_name); + die("usage: %s [+folder] [switches]", invo_name); } } @@ -402,11 +402,11 @@ main (int argc, char **argv) if (auth_svc == NULL) { if (saslmech && ! strcasecmp(saslmech, "xoauth2")) { - adios (NULL, "must specify -authservice with -saslmech xoauth2"); + die("must specify -authservice with -saslmech xoauth2"); } } else { if (user == NULL) { - adios (NULL, "must specify -user with -saslmech xoauth2"); + die("must specify -user with -saslmech xoauth2"); } } @@ -421,15 +421,15 @@ main (int argc, char **argv) */ if (pop_init (host, port, user, proxy, snoop, sasl, saslmech, tlsflag, auth_svc) == NOTOK) - adios (NULL, "%s", response); + die("%s", response); /* Check if there are any messages */ if (pop_stat (&nmsgs, &nbytes) == NOTOK) - adios (NULL, "%s", response); + die("%s", response); if (nmsgs == 0) { pop_quit(); - adios (NULL, "no mail to incorporate"); + die("no mail to incorporate"); } } else if (inc_type == INC_FILE) { @@ -444,7 +444,7 @@ main (int argc, char **argv) newmail = concat (MAILDIR, "/", MAILFIL, NULL); } if (stat (newmail, &s1) == NOTOK || s1.st_size == 0) - adios (NULL, "no mail to incorporate"); + die("no mail to incorporate"); if (s1.st_mode & S_IFDIR) { DIR *md; struct dirent *de; @@ -453,13 +453,13 @@ main (int argc, char **argv) i = 0; cp = concat (newmail, "/new", NULL); if ((md = opendir(cp)) == NULL) - adios (NULL, "unable to open %s", cp); + die("unable to open %s", cp); while ((de = readdir (md)) != NULL) { if (de->d_name[0] == '.') continue; if (i >= num_maildir_entries) { if ((Maildir = realloc(Maildir, sizeof(*Maildir) * (2*i+16))) == NULL) - adios(NULL, "not enough memory for %d messages", 2*i+16); + die("not enough memory for %d messages", 2*i+16); num_maildir_entries = 2*i+16; } Maildir[i].filename = concat (cp, "/", de->d_name, NULL); @@ -472,13 +472,13 @@ main (int argc, char **argv) closedir (md); cp = concat (newmail, "/cur", NULL); if ((md = opendir(cp)) == NULL) - adios (NULL, "unable to open %s", cp); + die("unable to open %s", cp); while ((de = readdir (md)) != NULL) { if (de->d_name[0] == '.') continue; if (i >= num_maildir_entries) { if ((Maildir = realloc(Maildir, sizeof(*Maildir) * (2*i+16))) == NULL) - adios(NULL, "not enough memory for %d messages", 2*i+16); + die("not enough memory for %d messages", 2*i+16); num_maildir_entries = 2*i+16; } Maildir[i].filename = concat (cp, "/", de->d_name, NULL); @@ -490,7 +490,7 @@ main (int argc, char **argv) free (cp); closedir (md); if (i == 0) - adios (NULL, "no mail to incorporate"); + die("no mail to incorporate"); num_maildir_entries = i; qsort (Maildir, num_maildir_entries, sizeof(*Maildir), maildir_srt); } @@ -521,7 +521,7 @@ main (int argc, char **argv) /* read folder and create message structure */ if (!(mp = folder_read (folder, 0))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); if (inc_type == INC_FILE && Maildir == NULL) { /* Mail from a spool file. */ @@ -539,7 +539,7 @@ main (int argc, char **argv) in = lkfopenspool (newmail, "r"); DROPGROUPPRIVS(); if (in == NULL) - adios (NULL, "unable to lock and fopen %s", newmail); + die("unable to lock and fopen %s", newmail); fstat (fileno(in), &s1); } else { trnflag = 0; @@ -601,7 +601,7 @@ main (int argc, char **argv) pc.written = 0; pc.mailout = pf; if (pop_retr(i, pop_action, &pc) == NOTOK) - adios (NULL, "%s", response); + die("%s", response); if (fflush (pf)) adios (cp, "write error on"); @@ -644,13 +644,13 @@ main (int argc, char **argv) free (cp); if (trnflag && pop_dele (i) == NOTOK) - adios (NULL, "%s", response); + die("%s", response); scan_finished(); } if (pop_quit () == NOTOK) - adios (NULL, "%s", response); + die("%s", response); } else if (inc_type == INC_FILE && Maildir == NULL) { /* Mail from a spool file. */ @@ -810,7 +810,7 @@ main (int argc, char **argv) } else { fclose (in); in = NULL; } - adios (NULL, "failed"); + die("failed"); } if (aud) diff --git a/uip/install-mh.c b/uip/install-mh.c index 3a1fa2a6..fb01e8de 100644 --- a/uip/install-mh.c +++ b/uip/install-mh.c @@ -55,7 +55,7 @@ main (int argc, char **argv) ambigsw (dp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown\n", dp); + die("-%s unknown\n", dp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches]", invo_name); @@ -74,7 +74,7 @@ main (int argc, char **argv) continue; } } else { - adios (NULL, "%s is invalid argument", dp); + die("%s is invalid argument", dp); } } @@ -85,7 +85,7 @@ main (int argc, char **argv) if ((mypath = getenv("HOME")) == NULL) { if ((pw = getpwuid(getuid())) == NULL || *pw->pw_dir == '\0') - adios(NULL, "cannot determine your home directory"); + die("cannot determine your home directory"); mypath = pw->pw_dir; } @@ -111,8 +111,8 @@ main (int argc, char **argv) if (check) done(0); if (autof) - adios (NULL, "invocation error"); - adios (NULL, "You already have an nmh profile, use an editor to modify it"); + die("invocation error"); + die("You already have an nmh profile, use an editor to modify it"); } if (check) done(1); @@ -168,7 +168,7 @@ query: cp = concat ("\"", pathname, "\" doesn't exist; Create it? ", NULL); if (autof || read_switch (cp, anoyes)) if (makedir (pathname) == 0) - adios (NULL, "unable to create %s", pathname); + die("unable to create %s", pathname); } else { puts("[Using existing directory]"); } diff --git a/uip/mark.c b/uip/mark.c index 1c92cafd..00cc2fb2 100644 --- a/uip/mark.c +++ b/uip/mark.c @@ -67,7 +67,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown\n", cp); + die("-%s unknown\n", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", @@ -93,7 +93,7 @@ main (int argc, char **argv) case SEQSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); svector_push_back (seqs, cp); seqp++; @@ -120,7 +120,7 @@ main (int argc, char **argv) } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else app_msgarg(&msgs, cp); @@ -151,7 +151,7 @@ main (int argc, char **argv) /* read folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* print some general debugging info */ if (debugsw) @@ -159,7 +159,7 @@ main (int argc, char **argv) /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) @@ -167,14 +167,14 @@ main (int argc, char **argv) done (1); if (publicsw == 1 && is_readonly(mp)) - adios (NULL, "folder %s is read-only, so -public not allowed", folder); + die("folder %s is read-only, so -public not allowed", folder); /* * Make sure at least one sequence has been * specified if we are adding or deleting. */ if (seqp == 0 && (addsw || deletesw)) - adios (NULL, "-%s requires at least one -sequence argument", + die("-%s requires at least one -sequence argument", addsw ? "add" : "delete"); /* Adding messages to sequences */ diff --git a/uip/mhbuild.c b/uip/mhbuild.c index 07074d75..c506432f 100644 --- a/uip/mhbuild.c +++ b/uip/mhbuild.c @@ -110,7 +110,7 @@ main (int argc, char **argv) while ((cp = *argp++)) { if (cp[0] == '-' && cp[1] == '\0') { if (compfile) - adios (NULL, "cannot specify both standard input and a file"); + die("cannot specify both standard input and a file"); compfile = cp; listsw = 0; /* turn off -list if using standard in/out */ verbosw = 0; /* turn off -verbose listings */ @@ -122,7 +122,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] file", invo_name); @@ -153,13 +153,13 @@ main (int argc, char **argv) icachesw = &wcachesw; do_cache: ; if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); switch (*icachesw = smatch (cp, cache_policy)) { case AMBIGSW: ambigsw (cp, cache_policy); done (1); case UNKWNSW: - adios (NULL, "%s unknown", cp); + die("%s unknown", cp); default: break; } @@ -218,13 +218,13 @@ main (int argc, char **argv) int encoding; if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); switch (encoding = smatch (cp, encodingswitches)) { case AMBIGSW: ambigsw (cp, encodingswitches); done (1); case UNKWNSW: - adios (NULL, "%s unknown encoding algorithm", cp); + die("%s unknown encoding algorithm", cp); case BASE64SW: header_encoding = CE_BASE64; break; @@ -235,7 +235,7 @@ main (int argc, char **argv) header_encoding = CE_8BIT; break; default: - adios (NULL, "Internal error: algorithm %s", cp); + die("Internal error: algorithm %s", cp); } continue; } @@ -246,11 +246,11 @@ main (int argc, char **argv) case MAXUNENCSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if ((maxunencoded = atoi(cp)) < 1) - adios (NULL, "Invalid argument for %s: %s", argp[-2], cp); + die("Invalid argument for %s: %s", argp[-2], cp); if (maxunencoded > 998) - adios (NULL, "limit of -maxunencoded is 998"); + die("limit of -maxunencoded is 998"); continue; case VERBSW: @@ -274,7 +274,7 @@ main (int argc, char **argv) } } if (compfile) - adios (NULL, "only one composition file allowed"); + die("only one composition file allowed"); compfile = cp; } @@ -312,14 +312,14 @@ main (int argc, char **argv) /* Check if we have a file to process */ if (!compfile) - adios (NULL, "need to specify a %s composition file", invo_name); + die("need to specify a %s composition file", invo_name); /* * Process the composition file from standard input. */ if (compfile[0] == '-' && compfile[1] == '\0') { if ((cp = m_mktemp2(NULL, invo_name, NULL, &fp)) == NULL) { - adios(NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } strncpy (infile, cp, sizeof(infile)); @@ -327,7 +327,7 @@ main (int argc, char **argv) /* copy standard input to temporary file */ while ((n = fread(buffer, 1, sizeof(buffer), stdin)) > 0) { if (fwrite(buffer, 1, n, fp) != n) { - adios (NULL, "error copying to temporary file"); + die("error copying to temporary file"); } } fclose (fp); @@ -343,11 +343,11 @@ main (int argc, char **argv) if (!ct) { if (! (fp = fopen(infile, "r"))) { - adios(NULL, "Unable to open %s for reading", infile); + die("Unable to open %s for reading", infile); } while ((n = fread(buffer, 1, sizeof(buffer), fp)) > 0) { if (fwrite(buffer, 1, n, stdout) != n) { - adios(NULL, "error copying %s to stdout", infile); + die("error copying %s to stdout", infile); } } } else { @@ -380,7 +380,7 @@ main (int argc, char **argv) /* output MIME message to this temporary file */ if ((cp = m_mktemp2(compfile, invo_name, NULL, &fp_out)) == NULL) { - adios(NULL, "unable to create temporary file"); + die("unable to create temporary file"); } strncpy(outfile, cp, sizeof(outfile)); diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index ba96ac44..6ab9564a 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -177,7 +177,7 @@ build_mime (char *infile, int autobuild, int dist, int directives, free (ct); return NULL; } - adios (NULL, "draft shouldn't contain %s: field", name); + die("draft shouldn't contain %s: field", name); } /* ignore any Content-Type fields in the header */ @@ -259,7 +259,7 @@ build_mime (char *infile, int autobuild, int dist, int directives, if (convert) { if (convert->filename && strcasecmp (convert->filename, filename)) { - adios (NULL, "Multiple %s headers with different files" + die("Multiple %s headers with different files" " not allowed", type); } else { convert->filename = mh_xstrdup(filename); @@ -299,7 +299,7 @@ build_mime (char *infile, int autobuild, int dist, int directives, if (convert) { if (convert->argstring && strcasecmp (convert->argstring, argstring)) { - adios (NULL, "Multiple %s headers with different " + die("Multiple %s headers with different " "argstrings not allowed", type); } else { convert->argstring = mh_xstrdup(argstring); @@ -335,10 +335,10 @@ finish_field: case LENERR: case FMTERR: - adios (NULL, "message format error in component #%d", compnum); + die("message format error in component #%d", compnum); default: - adios (NULL, "getfld() returned %d", state); + die("getfld() returned %d", state); } break; } @@ -352,7 +352,7 @@ finish_field: for (hp = ct->c_first_hf; hp != NULL; hp = hp->next) { if (encode_rfc2047(hp->name, &hp->value, header_encoding, NULL)) { - adios(NULL, "Unable to encode header \"%s\"", hp->name); + die("Unable to encode header \"%s\"", hp->name); } } } @@ -455,7 +455,7 @@ finish_field: /* Extract the type part (as a CT) from filename. */ cts = mh_xcalloc(2, sizeof *cts); if (! (cts[0] = parse_mime (convert_head->filename))) { - adios (NULL, "failed to parse %s", convert_head->filename); + die("failed to parse %s", convert_head->filename); } expand_pseudoheaders (cts[0], m, infile, convert_head); @@ -543,7 +543,7 @@ finish_field: compose_content (ct, verbose); if ((cp = strchr(prefix, 'a')) == NULL) - adios (NULL, "internal error(4)"); + die("internal error(4)"); /* * If using EAI, force 8-bit charset. @@ -562,7 +562,7 @@ finish_field: (*cp)++; } else { if (*++cp == 0) - adios (NULL, "giving up trying to find a unique delimiter string"); + die("giving up trying to find a unique delimiter string"); (*cp)++; } } @@ -713,7 +713,7 @@ user_content (FILE *in, char *buf, CT *ctp, const char *infilename) again_descr: ct->c_descr = add (buffer + i + 1, ct->c_descr); if (!fgetstr (buffer, sizeof(buffer) - 1, in)) - adios (NULL, "end-of-file after %s: field in plaintext", DESCR_FIELD); + die("end-of-file after %s: field in plaintext", DESCR_FIELD); switch (buffer[0]) { case ' ': case '\t': @@ -721,7 +721,7 @@ again_descr: goto again_descr; case '#': - adios (NULL, "#-directive after %s: field in plaintext", DESCR_FIELD); + die("#-directive after %s: field in plaintext", DESCR_FIELD); /* NOTREACHED */ default: @@ -736,7 +736,7 @@ again_descr: again_dispo: ct->c_dispo = add (buffer + i + 1, ct->c_dispo); if (!fgetstr (buffer, sizeof(buffer) - 1, in)) - adios (NULL, "end-of-file after %s: field in plaintext", DISPO_FIELD); + die("end-of-file after %s: field in plaintext", DISPO_FIELD); switch (buffer[0]) { case ' ': case '\t': @@ -744,7 +744,7 @@ again_dispo: goto again_dispo; case '#': - adios (NULL, "#-directive after %s: field in plaintext", DISPO_FIELD); + die("#-directive after %s: field in plaintext", DISPO_FIELD); /* NOTREACHED */ default: @@ -796,7 +796,7 @@ rock_and_roll: } /* FALLTHRU */ case CT_MULTIPART: - adios (NULL, "it doesn't make sense to define an in-line %s content", + die("it doesn't make sense to define an in-line %s content", ct->c_type == CT_MESSAGE ? "message" : "multipart"); /* NOTREACHED */ @@ -838,24 +838,23 @@ call_init: */ if (s2i->si_key) { if (!ci->ci_subtype) - adios (NULL, "missing subtype in \"#%s\"", ci->ci_type); + die("missing subtype in \"#%s\"", ci->ci_type); switch (ct->c_type = s2i->si_val) { case CT_MULTIPART: - adios (NULL, "use \"#begin ... #end\" instead of \"#%s/%s\"", + die("use \"#begin ... #end\" instead of \"#%s/%s\"", ci->ci_type, ci->ci_subtype); /* NOTREACHED */ case CT_MESSAGE: if (!strcasecmp (ci->ci_subtype, "partial")) - adios (NULL, "sorry, \"#%s/%s\" isn't supported", + die("sorry, \"#%s/%s\" isn't supported", ci->ci_type, ci->ci_subtype); if (!strcasecmp (ci->ci_subtype, "external-body")) - adios (NULL, "use \"#@type/subtype ... [] ...\" instead of \"#%s/%s\"", + die("use \"#@type/subtype ... [] ...\" instead of \"#%s/%s\"", ci->ci_type, ci->ci_subtype); use_forw: - adios (NULL, - "use \"#forw [+folder] [msgs]\" instead of \"#%s/%s\"", + die( "use \"#forw [+folder] [msgs]\" instead of \"#%s/%s\"", ci->ci_type, ci->ci_subtype); /* NOTREACHED */ @@ -873,7 +872,7 @@ use_forw: CT p; if (!ci->ci_magic) - adios (NULL, "need external information for \"#@%s/%s\"", + die("need external information for \"#@%s/%s\"", ci->ci_type, ci->ci_subtype); p = ct; @@ -915,7 +914,7 @@ use_forw: for (cp = ci->ci_magic + 1; isspace ((unsigned char) *cp); cp++) continue; if (!*cp) - adios (NULL, "empty pipe command for #%s directive", ci->ci_type); + die("empty pipe command for #%s directive", ci->ci_type); cp = mh_xstrdup(cp); free (ci->ci_magic); ci->ci_magic = cp; @@ -945,7 +944,7 @@ use_forw: } if (extrnal) - adios (NULL, "external definition not allowed for \"#%s\"", ci->ci_type); + die("external definition not allowed for \"#%s\"", ci->ci_type); /* * Message directive @@ -970,7 +969,7 @@ use_forw: cp = *ap; if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder per #forw directive"); + die("only one folder per #forw directive"); folder = pluspath (cp); } } @@ -980,7 +979,7 @@ use_forw: folder = mh_xstrdup(getfolder(1)); if (!(mp = folder_read (folder, 0))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); for (ap = arguments; *ap; ap++) { cp = *ap; if (*cp != '+' && *cp != '@') @@ -1096,7 +1095,7 @@ use_forw: if (user_content (in, buffer, &p, infilename) == DONE) { if (!m->mp_parts) - adios (NULL, "empty \"#begin ... #end\" sequence"); + die("empty \"#begin ... #end\" sequence"); return OK; } if (!p) @@ -1114,7 +1113,7 @@ use_forw: /* * Unknown directive */ - adios (NULL, "unknown directive \"#%s\"", ci->ci_type); + die("unknown directive \"#%s\"", ci->ci_type); return NOTOK; /* NOT REACHED */ } @@ -1230,7 +1229,7 @@ compose_content (CT ct, int verbose) char *tfile = NULL; if (!(cp = ci->ci_magic)) - adios (NULL, "internal error(5)"); + die("internal error(5)"); if ((tfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) { adios("mhbuildsbr", "unable to create temporary file in %s", @@ -1537,7 +1536,7 @@ scan_content (CT ct, size_t maxunencoded) if (checkllinelen && !linelen && (gotlen > MAXLONGLINE + 1)) { - adios(NULL, "Line in content exceeds maximum line limit (%d)", + die("Line in content exceeds maximum line limit (%d)", MAXLONGLINE); } @@ -1681,7 +1680,7 @@ build_headers (CT ct, int header_encoding) char *s = output_params(len, ci->ci_first_pm, &len, mailbody); if (!s) - adios(NULL, "Internal error: failed outputting Content-Type " + die("Internal error: failed outputting Content-Type " "parameters"); vp = add (s, vp); @@ -1725,7 +1724,7 @@ build_headers (CT ct, int header_encoding) vp = concat (" ", ct->c_descr, NULL); if (header_encoding != CE_8BIT) { if (encode_rfc2047(DESCR_FIELD, &vp, header_encoding, NULL)) { - adios(NULL, "Unable to encode %s header", DESCR_FIELD); + die("Unable to encode %s header", DESCR_FIELD); } } add_header (ct, np, vp); @@ -1788,7 +1787,7 @@ skip_headers: case CE_QUOTED: if (ct->c_type == CT_MESSAGE || ct->c_type == CT_MULTIPART) - adios (NULL, "internal error, invalid encoding"); + die("internal error, invalid encoding"); np = mh_xstrdup(ENCODING_FIELD); vp = concat (" ", "quoted-printable", "\n", NULL); @@ -1797,7 +1796,7 @@ skip_headers: case CE_BASE64: if (ct->c_type == CT_MESSAGE || ct->c_type == CT_MULTIPART) - adios (NULL, "internal error, invalid encoding"); + die("internal error, invalid encoding"); np = mh_xstrdup(ENCODING_FIELD); vp = concat (" ", "base64", "\n", NULL); @@ -1806,7 +1805,7 @@ skip_headers: case CE_BINARY: if (ct->c_type == CT_MESSAGE) - adios (NULL, "internal error, invalid encoding"); + die("internal error, invalid encoding"); np = mh_xstrdup(ENCODING_FIELD); vp = concat (" ", "binary", "\n", NULL); @@ -1814,7 +1813,7 @@ skip_headers: break; default: - adios (NULL, "unknown transfer encoding in content"); + die("unknown transfer encoding in content"); break; } @@ -1963,7 +1962,7 @@ setup_attach_content(CT ct, char *filename) PM pm; if (! (type = mime_type(filename))) { - adios(NULL, "Unable to determine MIME type of \"%s\"", filename); + die("Unable to determine MIME type of \"%s\"", filename); } /* @@ -1990,15 +1989,15 @@ setup_attach_content(CT ct, char *filename) switch (ct->c_type = s2i->si_val) { case CT_MULTIPART: - adios (NULL, "multipart types must be specified by mhbuild directives"); + die("multipart types must be specified by mhbuild directives"); /* NOTREACHED */ case CT_MESSAGE: if (strcasecmp(ct->c_ctinfo.ci_subtype, "partial") == 0) - adios(NULL, "Sorry, %s/%s isn't supported", ct->c_ctinfo.ci_type, + die("Sorry, %s/%s isn't supported", ct->c_ctinfo.ci_type, ct->c_ctinfo.ci_subtype); if (strcasecmp(ct->c_ctinfo.ci_subtype, "external-body") == 0) - adios(NULL, "external-body messages must be specified " + die("external-body messages must be specified " "by mhbuild directives"); /* FALLTHRU */ @@ -2094,7 +2093,7 @@ set_charset (CT ct, int contains8bit) { if (contains8bit == 1 && strcasecmp (eightbitcharset, "US-ASCII") == 0) { - adios (NULL, "Text content contains 8 bit characters, but " + die("Text content contains 8 bit characters, but " "character set is US-ASCII"); } @@ -2430,7 +2429,7 @@ extract_headers (CT ct, char *reply_file, FILE **reply_fp) { ct->c_subtype = TEXT_PLAIN; if (get_ctinfo ("text/plain", ct, 0) == NOTOK) { /* This never should fail, but just in case. */ - adios (NULL, "unable to get content info for reply"); + die("unable to get content info for reply"); } } diff --git a/uip/mhfixmsg.c b/uip/mhfixmsg.c index 486c7cc4..cbfc08c9 100644 --- a/uip/mhfixmsg.c +++ b/uip/mhfixmsg.c @@ -159,7 +159,7 @@ main (int argc, char **argv) { ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof buf, "%s [+folder] [msgs] [switches]", @@ -172,7 +172,7 @@ main (int argc, char **argv) { case DECODETEXTSW: if (! (cp = *argp++) || *cp == '-') { - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); } if (! strcasecmp (cp, "8bit")) { fx.decodetext = CE_8BIT; @@ -181,7 +181,7 @@ main (int argc, char **argv) { } else if (! strcasecmp (cp, "binary")) { fx.decodetext = CE_BINARY; } else { - adios (NULL, "invalid argument to %s", argp[-2]); + die("invalid argument to %s", argp[-2]); } continue; case NDECODETEXTSW: @@ -189,7 +189,7 @@ main (int argc, char **argv) { continue; case DECODETYPESW: if (! (cp = *argp++) || *cp == '-') { - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); } fx.decodetypes = cp; continue; @@ -201,7 +201,7 @@ main (int argc, char **argv) { continue; case TEXTCHARSETSW: if (! (cp = *argp++) || (*cp == '-' && cp[1])) { - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); } fx.textcharset = cp; continue; @@ -222,13 +222,13 @@ main (int argc, char **argv) { continue; case FIXTYPESW: if (! (cp = *argp++) || (*cp == '-' && cp[1])) { - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); } if (! strncasecmp (cp, "multipart/", 10) || ! strncasecmp (cp, "message/", 8)) - adios (NULL, "-fixtype %s not allowed", cp); + die("-fixtype %s not allowed", cp); if (! strchr (cp, '/')) - adios (NULL, "-fixtype requires type/subtype"); + die("-fixtype requires type/subtype"); if (fx.fixtypes == NULL) { fx.fixtypes = svector_create (10); } svector_push_back (fx.fixtypes, cp); continue; @@ -246,19 +246,19 @@ main (int argc, char **argv) { continue; case FILESW: if (! (cp = *argp++) || (*cp == '-' && cp[1])) { - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); } file = *cp == '-' ? mh_xstrdup (cp) : path (cp, TFILE); continue; case OUTFILESW: if (! (cp = *argp++) || (*cp == '-' && cp[1])) { - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); } outfile = *cp == '-' ? mh_xstrdup (cp) : path (cp, TFILE); continue; case RPROCSW: if (!(rmmproc = *argp++) || *rmmproc == '-') { - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); } continue; case NRPRCSW: @@ -280,7 +280,7 @@ main (int argc, char **argv) { } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else { if (*cp == '/') { @@ -311,7 +311,7 @@ main (int argc, char **argv) { } if (file && msgs.size) { - adios (NULL, "cannot specify msg and file at same time!"); + die("cannot specify msg and file at same time!"); } if (outfile) { @@ -341,7 +341,7 @@ main (int argc, char **argv) { using_stdin = 1; if ((cp = m_mktemp2 (NULL, invo_name, &fd, NULL)) == NULL) { - adios (NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } else { free (file); @@ -351,7 +351,7 @@ main (int argc, char **argv) { if (close (fd)) { (void) m_unlink (file); - adios (NULL, "failed to write temporary file"); + die("failed to write temporary file"); } } @@ -406,12 +406,12 @@ main (int argc, char **argv) { /* read folder and create message structure */ if (! (mp = folder_read (folder, 1))) { - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); } /* check for empty folder */ if (mp->nummsg == 0) { - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); } /* parse all the message ranges/sequences and set SELECTED */ @@ -542,12 +542,12 @@ mhfixmsgsbr (CT *ctp, char *maildir, const fix_transformations *fx, /* outfp will be closed by the caller */ if ((tempfile = m_mktemp2 (NULL, invo_name, NULL, outfp)) == NULL) { - adios (NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } outfile = mh_xstrdup (tempfile); } else { - adios (NULL, "missing both input and output filenames\n"); + die("missing both input and output filenames\n"); } } /* else *outfp was defined by caller */ @@ -1606,7 +1606,7 @@ decode_part (CT ct) { char *tempfile; if ((tempfile = m_mktemp2 (NULL, invo_name, NULL, &file)) == NULL) { - adios (NULL, "unable to create temporary file in %s", get_temp_dir()); + die("unable to create temporary file in %s", get_temp_dir()); } tmp_decoded = mh_xstrdup (tempfile); /* The following call will load ct->c_cefile.ce_file with the tmp @@ -2254,7 +2254,7 @@ strip_crs (CT ct, int *message_mods) { char *tempfile = m_mktemp2 (NULL, invo_name, &fd, NULL); if (tempfile == NULL) { - adios (NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } stripped_content_file = mh_xstrdup (tempfile); diff --git a/uip/mhical.c b/uip/mhical.c index b29be153..9cae3c38 100644 --- a/uip/mhical.c +++ b/uip/mhical.c @@ -92,7 +92,7 @@ main (int argc, char *argv[]) { ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: { char buf[128]; @@ -109,7 +109,7 @@ main (int argc, char *argv[]) { case REPLYSW: if (! (cp = *argp++) || (*cp == '-' && cp[1])) - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if (! strcasecmp (cp, "accept")) { action = ACT_ACCEPT; } else if (! strcasecmp (cp, "decline")) { @@ -119,7 +119,7 @@ main (int argc, char *argv[]) { } else if (! strcasecmp (cp, "delegate")) { action = ACT_DELEGATE; } else { - adios (NULL, "Unknown action: %s", cp); + die("Unknown action: %s", cp); } continue; @@ -129,23 +129,23 @@ main (int argc, char *argv[]) { case FORMSW: if (! (form = *argp++) || *form == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); format = NULL; continue; case FMTSW: if (! (format = *argp++) || *format == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); form = NULL; continue; case INFILESW: if (! (cp = *argp++) || (*cp == '-' && cp[1])) - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); infile = *cp == '-' ? mh_xstrdup(cp) : path (cp, TFILE); continue; case OUTFILESW: if (! (cp = *argp++) || (*cp == '-' && cp[1])) - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); outfile = *cp == '-' ? mh_xstrdup(cp) : path (cp, TFILE); continue; @@ -426,7 +426,7 @@ convert_common (contentline *clines, act action) { insert = "Tentative: "; break; case ACT_DELEGATE: - adios (NULL, "Delegate replies are not supported"); + die("Delegate replies are not supported"); break; case ACT_CANCEL: insert = "Cancelled:"; @@ -445,7 +445,7 @@ convert_common (contentline *clines, act action) { node->value = tmp; } else { /* Should never get here. */ - adios (NULL, "Unknown action: %d", action); + die("Unknown action: %d", action); } } diff --git a/uip/mhlist.c b/uip/mhlist.c index 9e4b9570..77e22274 100644 --- a/uip/mhlist.c +++ b/uip/mhlist.c @@ -95,7 +95,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", @@ -113,13 +113,13 @@ main (int argc, char **argv) icachesw = &wcachesw; do_cache: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); switch (*icachesw = smatch (cp, cache_policy)) { case AMBIGSW: ambigsw (cp, cache_policy); done (1); case UNKWNSW: - adios (NULL, "%s unknown", cp); + die("%s unknown", cp); default: break; } @@ -148,27 +148,27 @@ do_cache: case PARTSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if (npart >= NPARTS) - adios (NULL, "too many parts (starting with %s), %d max", + die("too many parts (starting with %s), %d max", cp, NPARTS); parts[npart++] = cp; continue; case TYPESW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if (ntype >= NTYPES) - adios (NULL, "too many types (starting with %s), %d max", + die("too many types (starting with %s), %d max", cp, NTYPES); types[ntype++] = cp; continue; case PREFERSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if (npreferred >= NPREFS) - adios (NULL, "too many preferred types (starting with %s), %d max", + die("too many preferred types (starting with %s), %d max", cp, NPREFS); mime_preference[npreferred].type = cp; cp = strchr(cp, '/'); @@ -182,7 +182,7 @@ do_cache: case FILESW: if (!(cp = *argp++) || (*cp == '-' && cp[1])) - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); file = *cp == '-' ? cp : path (cp, TFILE); continue; @@ -212,7 +212,7 @@ do_cache: } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else app_msgarg(&msgs, cp); @@ -235,7 +235,7 @@ do_cache: free (path ("./", TFOLDER)); if (file && msgs.size) - adios (NULL, "cannot specify msg and file at same time!"); + die("cannot specify msg and file at same time!"); /* * check if message is coming from file @@ -261,11 +261,11 @@ do_cache: /* read folder and create message structure */ if (!(mp = folder_read (folder, 0))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) diff --git a/uip/mhlogin.c b/uip/mhlogin.c index da4f639d..64885d12 100644 --- a/uip/mhlogin.c +++ b/uip/mhlogin.c @@ -57,15 +57,15 @@ do_login(const char *svc, const char *user, const char *browser, int snoop) const char *url; if (svc == NULL) { - adios(NULL, "missing -authservice switch"); + die("missing -authservice switch"); } if (user == NULL) { - adios(NULL, "missing -user switch"); + die("missing -user switch"); } if (!mh_oauth_new(&ctx, svc)) { - adios(NULL, "%s", mh_oauth_get_err_string(ctx)); + die("%s", mh_oauth_get_err_string(ctx)); } if (snoop) { @@ -75,7 +75,7 @@ do_login(const char *svc, const char *user, const char *browser, int snoop) fn = mh_oauth_cred_fn(svc); if ((url = mh_oauth_get_authorize_url(ctx)) == NULL) { - adios(NULL, "%s", mh_oauth_get_err_string(ctx)); + die("%s", mh_oauth_get_err_string(ctx)); } if (browser) { @@ -111,7 +111,7 @@ do_login(const char *svc, const char *user, const char *browser, int snoop) } if (cred == NULL) { inform("error exchanging code for OAuth2 token"); - adios(NULL, "%s", mh_oauth_get_err_string(ctx)); + die("%s", mh_oauth_get_err_string(ctx)); } cred_file = lkfopendata(fn, "r+", &failed_to_lock); @@ -122,7 +122,7 @@ do_login(const char *svc, const char *user, const char *browser, int snoop) adios(fn, "oops"); } if (!mh_oauth_cred_save(cred_file, cred, user)) { - adios(NULL, "%s", mh_oauth_get_err_string(ctx)); + die("%s", mh_oauth_get_err_string(ctx)); } if (lkfclosedata(cred_file, fn) != 0) { adios (fn, "oops"); @@ -156,7 +156,7 @@ main(int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf(help, sizeof(help), "%s [switches]", @@ -169,22 +169,22 @@ main(int argc, char **argv) case USERSW: if (!(user = *argp++) || *user == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case SASLMECHSW: if (!(saslmech = *argp++) || *saslmech == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case AUTHSERVICESW: if (!(svc = *argp++) || *svc == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case BROWSERSW: if (!(browser = *argp++) || *browser == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case SNOOPSW: @@ -192,12 +192,12 @@ main(int argc, char **argv) continue; } } - adios(NULL, "extraneous arguments"); + die("extraneous arguments"); } if (saslmech && strcasecmp(saslmech, "xoauth2")) { /* xoauth is assumed */ - adios(NULL, "only -saslmech xoauth2 is supported"); + die("only -saslmech xoauth2 is supported"); } free(arguments); @@ -207,7 +207,7 @@ main(int argc, char **argv) NMH_UNUSED(svc); NMH_UNUSED(browser); NMH_UNUSED(snoop); - adios(NULL, "not built with OAuth support"); + die("not built with OAuth support"); return 1; #endif } diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index 1c8ab4e0..e7070fd3 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -1742,11 +1742,11 @@ filterbody (struct mcomp *c1, char *buf, int bufsz, int state, */ if (pipe(fdinput) < 0) { - adios(NULL, "Unable to create input pipe"); + die("Unable to create input pipe"); } if (pipe(fdoutput) < 0) { - adios(NULL, "Unable to create output pipe"); + die("Unable to create output pipe"); } /* @@ -1801,7 +1801,7 @@ filterbody (struct mcomp *c1, char *buf, int bufsz, int state, */ _exit(0); case -1: - adios(NULL, "Unable to fork for filter writer process"); + die("Unable to fork for filter writer process"); break; } @@ -1876,7 +1876,7 @@ filterbody (struct mcomp *c1, char *buf, int bufsz, int state, break; case -1: - adios(NULL, "Unable to fork format program"); + die("Unable to fork format program"); } /* @@ -1899,7 +1899,7 @@ filterbody (struct mcomp *c1, char *buf, int bufsz, int state, } if (cc < 0) { - adios(NULL, "reading from formatproc"); + die("reading from formatproc"); } /* diff --git a/uip/mhn.c b/uip/mhn.c index a5b4a274..ce532799 100644 --- a/uip/mhn.c +++ b/uip/mhn.c @@ -134,7 +134,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", @@ -166,13 +166,13 @@ main (int argc, char **argv) icachesw = &wcachesw; do_cache: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); switch (*icachesw = smatch (cp, cache_policy)) { case AMBIGSW: ambigsw (cp, cache_policy); done (1); case UNKWNSW: - adios (NULL, "%s unknown", cp); + die("%s unknown", cp); default: break; } @@ -222,31 +222,31 @@ do_cache: case PARTSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if (npart >= NPARTS) - adios (NULL, "too many parts (starting with %s), %d max", + die("too many parts (starting with %s), %d max", cp, NPARTS); parts[npart++] = cp; continue; case TYPESW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if (ntype >= NTYPES) - adios (NULL, "too many types (starting with %s), %d max", + die("too many types (starting with %s), %d max", cp, NTYPES); types[ntype++] = cp; continue; case FILESW: if (!(cp = *argp++) || (*cp == '-' && cp[1])) - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); file = *cp == '-' ? cp : path (cp, TFILE); continue; case FORMSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); free(formsw); formsw = mh_xstrdup(etcpath(cp)); continue; @@ -256,7 +256,7 @@ do_cache: */ case PROGSW: if (!(progsw = *argp++) || *progsw == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case NPROGSW: nomore++; @@ -265,7 +265,7 @@ do_cache: case LENSW: case WIDTHSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; /* @@ -297,7 +297,7 @@ do_cache: } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else app_msgarg(&msgs, cp); @@ -352,11 +352,11 @@ do_cache: int vecp; if (showsw || storesw || cachesw) - adios (NULL, "cannot use -build with -show, -store, -cache"); + die("cannot use -build with -show, -store, -cache"); if (msgs.size < 1) - adios (NULL, "need to specify a %s composition file", invo_name); + die("need to specify a %s composition file", invo_name); if (msgs.size > 1) - adios (NULL, "only one %s composition file at a time", invo_name); + die("only one %s composition file at a time", invo_name); vecp = 0; vec[vecp++] = "mhbuild"; @@ -402,7 +402,7 @@ do_cache: } if (file && msgs.size) - adios (NULL, "cannot specify msg and file at same time!"); + die("cannot specify msg and file at same time!"); /* * check if message is coming from file @@ -428,11 +428,11 @@ do_cache: /* read folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) @@ -462,7 +462,7 @@ do_cache: * at a time. */ if (showsw + listsw + storesw + cachesw > 1) - adios (NULL, "can only use one of -show, -list, -store, -cache at same time"); + die("can only use one of -show, -list, -store, -cache at same time"); /* If no action is specified, assume -show */ if (!listsw && !showsw && !storesw && !cachesw) diff --git a/uip/mhparam.c b/uip/mhparam.c index e8047be6..abb44b36 100644 --- a/uip/mhparam.c +++ b/uip/mhparam.c @@ -157,7 +157,7 @@ main(int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [profile-components] [switches]", diff --git a/uip/mhparse.c b/uip/mhparse.c index 1c4a1a96..d634a06a 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -361,10 +361,10 @@ get_content (FILE *in, char *file, int toplevel) case LENERR: case FMTERR: - adios (NULL, "message format error in component #%d", compnum); + die("message format error in component #%d", compnum); default: - adios (NULL, "getfld() returned %d", state); + die("getfld() returned %d", state); } /* break out of the loop */ @@ -1511,7 +1511,7 @@ invalid_param: adios ("failed", "fread"); case OK: - adios (NULL, "unexpected EOF from fread"); + die("unexpected EOF from fread"); default: bp += cc, size -= cc; @@ -1780,7 +1780,7 @@ openBase64 (CT ct, char **file) if (ce->ce_unlink) { /* Create temporary file with filename extension. */ if ((ce->ce_file = m_mktemps(invo_name, cp, NULL, NULL)) == NULL) { - adios(NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } } else { @@ -1789,7 +1789,7 @@ openBase64 (CT ct, char **file) } else if (*file == NULL) { char *tempfile; if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) { - adios(NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } ce->ce_file = mh_xstrdup(tempfile); @@ -1801,7 +1801,7 @@ openBase64 (CT ct, char **file) } if ((len = ct->c_end - ct->c_begin) < 0) - adios (NULL, "internal error(1)"); + die("internal error(1)"); buffer = mh_xmalloc (len + 1); @@ -1965,7 +1965,7 @@ openQuoted (CT ct, char **file) if (ce->ce_unlink) { /* Create temporary file with filename extension. */ if ((ce->ce_file = m_mktemps(invo_name, cp, NULL, NULL)) == NULL) { - adios(NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } } else { @@ -1974,7 +1974,7 @@ openQuoted (CT ct, char **file) } else if (*file == NULL) { char *tempfile; if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) { - adios(NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } ce->ce_file = mh_xstrdup(tempfile); @@ -1986,7 +1986,7 @@ openQuoted (CT ct, char **file) } if ((len = ct->c_end - ct->c_begin) < 0) - adios (NULL, "internal error(2)"); + die("internal error(2)"); if (! ct->c_fp) { if ((ct->c_fp = fopen (ct->c_file, "r")) == NULL) { @@ -2181,7 +2181,7 @@ open7Bit (CT ct, char **file) if (ce->ce_unlink) { /* Create temporary file with filename extension. */ if ((ce->ce_file = m_mktemps(invo_name, cp, NULL, NULL)) == NULL) { - adios(NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } } else { @@ -2190,7 +2190,7 @@ open7Bit (CT ct, char **file) } else if (*file == NULL) { char *tempfile; if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) { - adios(NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } ce->ce_file = mh_xstrdup(tempfile); @@ -2239,7 +2239,7 @@ open7Bit (CT ct, char **file) } if ((len = ct->c_end - ct->c_begin) < 0) - adios (NULL, "internal error(3)"); + die("internal error(3)"); if (! ct->c_fp) { if ((ct->c_fp = fopen (ct->c_file, "r")) == NULL) { @@ -2540,7 +2540,7 @@ openFTP (CT ct, char **file) else { char *tempfile; if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) { - adios(NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } ce->ce_file = mh_xstrdup(tempfile); @@ -2725,7 +2725,7 @@ openMail (CT ct, char **file) if (*file == NULL) { char *tempfile; if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) { - adios(NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } ce->ce_file = mh_xstrdup(tempfile); @@ -2816,7 +2816,7 @@ openURL (CT ct, char **file) else { char *tempfile; if ((tempfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) { - adios(NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } ce->ce_file = mh_xstrdup(tempfile); @@ -3867,7 +3867,7 @@ param_len(PM pm, int index, size_t valueoff, int *encode, int *cont, if (! pm->pm_charset) { pm->pm_charset = mh_xstrdup(write_charset_8bit()); if (strcasecmp(pm->pm_charset, "US-ASCII") == 0) - adios(NULL, "8-bit characters in parameter \"%s\", but " + die("8-bit characters in parameter \"%s\", but " "local character set is US-ASCII", pm->pm_name); } if (! pm->pm_lang) diff --git a/uip/mhpath.c b/uip/mhpath.c index 1e6ab515..ceed4762 100644 --- a/uip/mhpath.c +++ b/uip/mhpath.c @@ -47,7 +47,7 @@ main(int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", @@ -61,7 +61,7 @@ main(int argc, char **argv) } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else app_msgarg(&msgs, cp); @@ -85,7 +85,7 @@ main(int argc, char **argv) /* read folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* * We need to make sure there is message status space @@ -95,10 +95,10 @@ main(int argc, char **argv) */ if (mp->hghmsg >= mp->hghoff) { if (!(mp = folder_realloc (mp, 1, mp->hghmsg + 10))) - adios (NULL, "unable to allocate folder storage"); + die("unable to allocate folder storage"); } else if (mp->lowoff > 1) { if (!(mp = folder_realloc (mp, 1, mp->hghoff))) - adios (NULL, "unable to allocate folder storage"); + die("unable to allocate folder storage"); } mp->msgflags |= ALLOW_NEW; /* allow the "new" sequence */ diff --git a/uip/mhshow.c b/uip/mhshow.c index 13fa3b7c..f03c5702 100644 --- a/uip/mhshow.c +++ b/uip/mhshow.c @@ -109,7 +109,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", @@ -127,13 +127,13 @@ main (int argc, char **argv) icachesw = &wcachesw; do_cache: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); switch (*icachesw = smatch (cp, cache_policy)) { case AMBIGSW: ambigsw (cp, cache_policy); done (1); case UNKWNSW: - adios (NULL, "%s unknown", cp); + die("%s unknown", cp); default: break; } @@ -167,27 +167,27 @@ do_cache: case PARTSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if (npart >= NPARTS) - adios (NULL, "too many parts (starting with %s), %d max", + die("too many parts (starting with %s), %d max", cp, NPARTS); parts[npart++] = cp; continue; case TYPESW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if (ntype >= NTYPES) - adios (NULL, "too many types (starting with %s), %d max", + die("too many types (starting with %s), %d max", cp, NTYPES); types[ntype++] = cp; continue; case PREFERSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if (npreferred >= NPREFS) - adios (NULL, "too many preferred types (starting with %s), %d max", + die("too many preferred types (starting with %s), %d max", cp, NPREFS); mime_preference[npreferred].type = cp; cp = strchr(cp, '/'); @@ -201,13 +201,13 @@ do_cache: case FILESW: if (!(cp = *argp++) || (*cp == '-' && cp[1])) - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); file = *cp == '-' ? cp : path (cp, TFILE); continue; case FORMSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); free(formsw); formsw = mh_xstrdup(etcpath(cp)); continue; @@ -221,12 +221,12 @@ do_cache: case HEADFORMSW: if (!(headerform = *argp++) || *headerform == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case MARKFORMSW: if (!(markerform = *argp++) || *markerform == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; /* @@ -234,7 +234,7 @@ do_cache: */ case PROGSW: if (!(progsw = *argp++) || *progsw == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case NPROGSW: nomore++; @@ -243,7 +243,7 @@ do_cache: case LENSW: case WIDTHSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case VERBSW: @@ -259,7 +259,7 @@ do_cache: } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else app_msgarg(&msgs, cp); @@ -314,7 +314,7 @@ do_cache: free (path ("./", TFOLDER)); if (file && msgs.size) - adios (NULL, "cannot specify msg and file at same time!"); + die("cannot specify msg and file at same time!"); /* * check if message is coming from file @@ -342,11 +342,11 @@ do_cache: /* read folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) diff --git a/uip/mhshowsbr.c b/uip/mhshowsbr.c index 5283179d..5d664090 100644 --- a/uip/mhshowsbr.c +++ b/uip/mhshowsbr.c @@ -1084,7 +1084,7 @@ convert_charset (CT ct, char *dest_charset, int *message_mods) { } if ((tempfile = m_mktemp2 (NULL, invo_name, &fd, NULL)) == NULL) { - adios (NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } dest = mh_xstrdup(tempfile); diff --git a/uip/mhstore.c b/uip/mhstore.c index b7c9943b..a8482240 100644 --- a/uip/mhstore.c +++ b/uip/mhstore.c @@ -94,7 +94,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", @@ -119,13 +119,13 @@ main (int argc, char **argv) icachesw = &wcachesw; do_cache: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); switch (*icachesw = smatch (cp, cache_policy)) { case AMBIGSW: ambigsw (cp, cache_policy); done (1); case UNKWNSW: - adios (NULL, "%s unknown", cp); + die("%s unknown", cp); default: break; } @@ -140,27 +140,27 @@ do_cache: case PARTSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if (npart >= NPARTS) - adios (NULL, "too many parts (starting with %s), %d max", + die("too many parts (starting with %s), %d max", cp, NPARTS); parts[npart++] = cp; continue; case TYPESW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if (ntype >= NTYPES) - adios (NULL, "too many types (starting with %s), %d max", + die("too many types (starting with %s), %d max", cp, NTYPES); types[ntype++] = cp; continue; case PREFERSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if (npreferred >= NPREFS) - adios (NULL, "too many preferred types (starting with %s), %d max", + die("too many preferred types (starting with %s), %d max", cp, NPREFS); mime_preference[npreferred].type = cp; cp = strchr(cp, '/'); @@ -174,13 +174,13 @@ do_cache: case FILESW: if (!(cp = *argp++) || (*cp == '-' && cp[1])) - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); file = *cp == '-' ? cp : path (cp, TFILE); continue; case OUTFILESW: if (!(cp = *argp++) || (*cp == '-' && cp[1])) - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); outfile = *cp == '-' ? cp : path (cp, TFILE); continue; @@ -192,7 +192,7 @@ do_cache: continue; case CLOBBERSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); clobbersw = cp; continue; case DEBUGSW: @@ -202,7 +202,7 @@ do_cache: } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else app_msgarg(&msgs, cp); @@ -250,7 +250,7 @@ do_cache: free (path ("./", TFOLDER)); if (file && msgs.size) - adios (NULL, "cannot specify msg and file at same time!"); + die("cannot specify msg and file at same time!"); /* * check if message is coming from file @@ -280,11 +280,11 @@ do_cache: /* read folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) diff --git a/uip/mhstoresbr.c b/uip/mhstoresbr.c index a9993d6d..f579fcd9 100644 --- a/uip/mhstoresbr.c +++ b/uip/mhstoresbr.c @@ -566,7 +566,7 @@ store_content (CT ct, CT p, mhstoreinfo_t info) /* Store content in temporary file for now */ if ((tmpfilenam = m_mktemp(invo_name, NULL, NULL)) == NULL) { - adios(NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } ct->c_storage = mh_xstrdup(tmpfilenam); @@ -1139,7 +1139,7 @@ clobber_policy (const char *value) { return NMH_CLOBBER_NEVER; } - adios (NULL, "invalid argument, %s, to clobber", value); + die("invalid argument, %s, to clobber", value); } diff --git a/uip/mkstemp.c b/uip/mkstemp.c index 7028d43a..3cb95ffb 100644 --- a/uip/mkstemp.c +++ b/uip/mkstemp.c @@ -181,7 +181,7 @@ process_args(int argc, char **argv, const char **directory, case DIRECTORYSW: /* Allow the directory to start with '-'. */ if ((cp = *argp++) == NULL) { - adios(NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); } *directory = cp; continue; @@ -189,7 +189,7 @@ process_args(int argc, char **argv, const char **directory, case PREFIXSW: /* Allow the prefix to start with '-'. */ if ((cp = *argp++) == NULL) { - adios(NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); } *prefix = cp; continue; @@ -198,7 +198,7 @@ process_args(int argc, char **argv, const char **directory, case SUFFIXSW: /* Allow the suffix to start with '-'. */ if ((cp = *argp++) == NULL) { - adios(NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); } *suffix = cp; continue; diff --git a/uip/msgchk.c b/uip/msgchk.c index 5551e504..dac9cda0 100644 --- a/uip/msgchk.c +++ b/uip/msgchk.c @@ -100,7 +100,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] [users ...]", @@ -120,30 +120,30 @@ main (int argc, char **argv) case NOTESW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); notifysw |= donote (cp, 1); continue; case NNOTESW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); notifysw &= ~donote (cp, 0); continue; case HOSTSW: if (!(host = *argp++) || *host == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case PORTSW: if (!(port = *argp++) || *port == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case USERSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if (vecp >= MAXVEC-1) - adios (NULL, "you can only check %d users at a time", MAXVEC-1); + die("you can only check %d users at a time", MAXVEC-1); user = vec[vecp++] = cp; continue; @@ -161,7 +161,7 @@ main (int argc, char **argv) case SASLMECHSW: if (!(saslmech = *argp++) || *saslmech == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case INITTLSSW: @@ -183,20 +183,20 @@ main (int argc, char **argv) case AUTHSERVICESW: #ifdef OAUTH_SUPPORT if (!(auth_svc = *argp++) || *auth_svc == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); #else - adios (NULL, "not built with OAuth support"); + die("not built with OAuth support"); #endif continue; case PROXYSW: if (!(proxy = *argp++) || *proxy == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; } } if (vecp >= MAXVEC-1) - adios (NULL, "you can only check %d users at a time", MAXVEC-1); + die("you can only check %d users at a time", MAXVEC-1); vec[vecp++] = cp; } @@ -243,7 +243,7 @@ main (int argc, char **argv) if (!geteuid() || NULL == (home = getenv("HOME"))) { pw = getpwnam (user); if (pw == NULL) - adios (NULL, "unable to get information about user"); + die("unable to get information about user"); home = pw->pw_dir; } status = checkmail (user, home, datesw, notifysw, 1); @@ -284,7 +284,7 @@ donote (char *cp, int ntflag) ambigsw (cp, ntswitches); done (1); case UNKWNSW: - adios (NULL, "-%snotify %s unknown", ntflag ? "" : "no", cp); + die("-%snotify %s unknown", ntflag ? "" : "no", cp); case NALLSW: return NT_ALL; @@ -348,11 +348,11 @@ remotemail (char *host, char *port, char *user, char *proxy, int notifysw, if (auth_svc == NULL) { if (saslmech && ! strcasecmp(saslmech, "xoauth2")) { - adios (NULL, "must specify -authservice with -saslmech xoauth2"); + die("must specify -authservice with -saslmech xoauth2"); } } else { if (user == NULL) { - adios (NULL, "must specify -user with -saslmech xoauth2"); + die("must specify -user with -saslmech xoauth2"); } } diff --git a/uip/new.c b/uip/new.c index d608883d..2d035a16 100644 --- a/uip/new.c +++ b/uip/new.c @@ -176,14 +176,14 @@ get_msgnums(char *folder, char *sequences[]) continue; case BODY: - adios (NULL, "no blank lines are permitted in %s", seqfile); + die("no blank lines are permitted in %s", seqfile); break; case FILEEOF: break; default: - adios (NULL, "%s is poorly formatted", seqfile); + die("%s is poorly formatted", seqfile); } break; /* break from for loop */ } @@ -274,7 +274,7 @@ check_folders(struct node **first, struct node **last, } else { fp = fopen(folders, "r"); if (fp == NULL) { - adios(NULL, "failed to read %s", folders); + die("failed to read %s", folders); } while (vfgets(fp, &line) == OK) { len = strlen(line) - 1; @@ -459,7 +459,7 @@ main(int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (help, sizeof(help), "%s [switches] [sequences]", @@ -472,11 +472,11 @@ main(int argc, char **argv) case FOLDERSSW: if (!(folders = *argp++) || *folders == '-') - adios(NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case MODESW: if (!(invo_name = *argp++) || *invo_name == '-') - adios(NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); invo_name = r1bindex(invo_name, '/'); continue; } @@ -508,7 +508,7 @@ main(int argc, char **argv) /* no sequence arguments; use unseen */ unseen = context_find(usequence); if (unseen == NULL || unseen[0] == '\0') { - adios(NULL, "must specify sequences or set %s", usequence); + die("must specify sequences or set %s", usequence); } for (ap = brkstring(unseen, " ", "\n"); *ap; ap++) { svector_push_back (sequences, *ap); diff --git a/uip/packf.c b/uip/packf.c index 4d25c38e..1dce11ed 100644 --- a/uip/packf.c +++ b/uip/packf.c @@ -62,7 +62,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", @@ -75,9 +75,9 @@ main (int argc, char **argv) case FILESW: if (file) - adios (NULL, "only one file at a time!"); + die("only one file at a time!"); if (!(file = *argp++) || *file == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case MBOXSW: @@ -90,7 +90,7 @@ main (int argc, char **argv) } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else app_msgarg(&msgs, cp); @@ -129,11 +129,11 @@ main (int argc, char **argv) /* read folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) diff --git a/uip/pick.c b/uip/pick.c index d252f3cc..0a1ea244 100644 --- a/uip/pick.c +++ b/uip/pick.c @@ -90,7 +90,7 @@ main (int argc, char **argv) listsw = 0; /* HACK */ done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", @@ -119,11 +119,11 @@ main (int argc, char **argv) vec[vecp++] = --cp; pattern: if (!(cp = *argp++))/* allow -xyz arguments */ - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); vec[vecp++] = cp; continue; case OTHRSW: - adios (NULL, "internal error!"); + die("internal error!"); case ANDSW: case ORSW: @@ -135,7 +135,7 @@ main (int argc, char **argv) case SEQSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if (!seq_nameok (cp)) done (1); @@ -173,7 +173,7 @@ main (int argc, char **argv) } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else app_msgarg(&msgs, cp); @@ -199,11 +199,11 @@ main (int argc, char **argv) /* read folder and create message structure */ if (!(mp = folder_read (folder, 0))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) @@ -218,7 +218,7 @@ main (int argc, char **argv) listsw = !seqp; if (publicsw == 1 && is_readonly(mp)) - adios (NULL, "folder %s is read-only, so -public not allowed", folder); + die("folder %s is read-only, so -public not allowed", folder); if (!pcompile (vec, NULL)) done (1); @@ -258,7 +258,7 @@ main (int argc, char **argv) } if (nums.size >= mp->numsel) - adios (NULL, "no messages match specification"); + die("no messages match specification"); /* * So, what's happening here? @@ -271,7 +271,7 @@ main (int argc, char **argv) */ if (!(mp2 = folder_read (folder, 1))) - adios (NULL, "unable to reread folder %s", folder); + die("unable to reread folder %s", folder); for (msgnum = 0; msgnum < msgs.size; msgnum++) if (!m_convert (mp2, msgs.msgs[msgnum])) diff --git a/uip/picksbr.c b/uip/picksbr.c index 2eddab7f..a5184799 100644 --- a/uip/picksbr.c +++ b/uip/picksbr.c @@ -958,7 +958,7 @@ TWSaction(struct nexus *n, FILE *fp, int msgnum, long start, long stop) return 0; default: - adios (NULL, "internal error -- you lose"); + die("internal error -- you lose"); } break; } diff --git a/uip/post.c b/uip/post.c index 93531c99..dbe936b6 100644 --- a/uip/post.c +++ b/uip/post.c @@ -339,7 +339,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] file", invo_name); @@ -351,7 +351,7 @@ main (int argc, char **argv) case LIBSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); /* create a minimal context */ if (context_foil (cp) == -1) done (1); @@ -359,9 +359,9 @@ main (int argc, char **argv) case ALIASW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if ((state = alias (cp)) != AK_OK) - adios (NULL, "aliasing error in %s - %s", + die("aliasing error in %s - %s", cp, akerror (state)); continue; @@ -382,7 +382,7 @@ main (int argc, char **argv) case FILTSW: if (!(filter = *argp++) || *filter == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); mime = 0; continue; case NFILTSW: @@ -438,25 +438,25 @@ main (int argc, char **argv) case WIDTHSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if ((outputlinelen = atoi (cp)) < 10) - adios (NULL, "impossible width %d", outputlinelen); + die("impossible width %d", outputlinelen); continue; case ANNOSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if ((pfd = atoi (cp)) <= 2) - adios (NULL, "bad argument %s %s", argp[-2], cp); + die("bad argument %s %s", argp[-2], cp); continue; case CLIESW: if (!(clientsw = *argp++) || *clientsw == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case SERVSW: if (!(serversw = *argp++) || *serversw == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case SNOOPSW: snoop++; @@ -464,7 +464,7 @@ main (int argc, char **argv) case PARTSW: if (!(partno = *argp++) || *partno == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case SASLSW: @@ -477,12 +477,12 @@ main (int argc, char **argv) case SASLMECHSW: if (!(saslmech = *argp++) || *saslmech == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case AUTHSERVICESW: if (!(auth_svc = *argp++) || *auth_svc == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); oauth_flag++; continue; @@ -497,7 +497,7 @@ main (int argc, char **argv) int i; if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); for (i = 0; oauthswitches[i].profname != NULL; i++) { if (oauthswitches[i].switchnum == swnum) { @@ -507,7 +507,7 @@ main (int argc, char **argv) } if (oauthswitches[i].profname == NULL) - adios (NULL, "internal error: cannot map switch %s " + die("internal error: cannot map switch %s " "to profile entry", argp[-2]); oauth_flag++; @@ -516,12 +516,12 @@ main (int argc, char **argv) case USERSW: if (!(user = *argp++) || *user == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case PORTSW: if (!(port = *argp++) || *port == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case TLSSW: @@ -546,55 +546,55 @@ main (int argc, char **argv) case FILEPROCSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); fileproc = cp; continue; case MHLPROCSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); mhlproc = cp; continue; case MTSSM: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); sendmail = cp; continue; case MTSSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); save_mts_method (cp); continue; case CREDENTIALSSW: { if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); add_profile_entry ("credentials", cp); continue; } case MESSAGEIDSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if (save_message_id_style (cp) != 0) - adios (NULL, "unsupported messageid \"%s\"", cp); + die("unsupported messageid \"%s\"", cp); continue; } } if (msg) - adios (NULL, "only one message at a time!"); + die("only one message at a time!"); msg = cp; } alias (AliasFile); if (!msg) - adios (NULL, "usage: %s [switches] file", invo_name); + die("usage: %s [switches] file", invo_name); if (outputlinelen < 10) - adios (NULL, "impossible width %d", outputlinelen); + die("impossible width %d", outputlinelen); if ((in = fopen (msg, "r")) == NULL) adios (msg, "unable to open"); @@ -610,7 +610,7 @@ main (int argc, char **argv) } else { char *cp = m_mktemp2(NULL, invo_name, NULL, &out); if (cp == NULL) { - adios(NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } strncpy(tmpfil, cp, sizeof(tmpfil)); @@ -654,10 +654,10 @@ main (int argc, char **argv) case LENERR: case FMTERR: - adios (NULL, "message format error in component #%d", compnum); + die("message format error in component #%d", compnum); default: - adios (NULL, "getfld() returned %d", state); + die("getfld() returned %d", state); } break; } @@ -727,7 +727,7 @@ main (int argc, char **argv) char sbuf[128]; if (auth_svc == NULL) { - adios(NULL, "No authentication service given with -authservice"); + die("No authentication service given with -authservice"); } for (i = 0; oauthswitches[i].profname != NULL; i++) { @@ -1000,8 +1000,7 @@ putfmt (char *name, char *str, int *eai, FILE *out) aliases and put them in Bcc:, but then they'd have the Blind-Carbon-Copy indication. */ - adios (NULL, - "blind lists not compatible with" + die( "blind lists not compatible with" " sendmail/pipe"); } @@ -1211,9 +1210,9 @@ finish_headers (FILE *out) } if (badmsg) - adios (NULL, "re-format message and try again"); + die("re-format message and try again"); if (!recipients) - adios (NULL, "no addressees"); + die("no addressees"); } @@ -1447,7 +1446,7 @@ insert_fcc (struct headers *hdr, char *pp) return; if (fccind >= FCCS) - adios (NULL, "too many %ss", hdr->value); + die("too many %ss", hdr->value); fccfold[fccind++] = mh_xstrdup(cp); } @@ -1465,7 +1464,7 @@ make_bcc_file (int dashstuff) char *tfile = NULL, *program; if ((tfile = m_mktemp2(NULL, "bccs", NULL, &out)) == NULL) { - adios(NULL, "unable to create temporary file in %s", get_temp_dir()); + die("unable to create temporary file in %s", get_temp_dir()); } strncpy (bccfil, tfile, sizeof(bccfil)); @@ -1490,12 +1489,12 @@ make_bcc_file (int dashstuff) * prefix and check again. */ if ((cp = strchr(prefix, 'a')) == NULL) - adios (NULL, "lost prefix start"); + die("lost prefix start"); while (find_prefix () == NOTOK) { if (*cp < 'z') (*cp)++; else if (*++cp == 0) - adios (NULL, "can't find a unique delimiter string"); + die("can't find a unique delimiter string"); else (*cp)++; } diff --git a/uip/prompter.c b/uip/prompter.c index 3a51dbe3..4336ff22 100644 --- a/uip/prompter.c +++ b/uip/prompter.c @@ -79,7 +79,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buffer, sizeof(buffer), "%s [switches] file", @@ -92,11 +92,11 @@ main (int argc, char **argv) case ERASESW: if (!(erasep = *argp++) || *erasep == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case KILLSW: if (!(killp = *argp++) || *killp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case PREPSW: @@ -133,12 +133,12 @@ main (int argc, char **argv) } if (!drft) - adios (NULL, "usage: %s [switches] file", invo_name); + die("usage: %s [switches] file", invo_name); if ((in = fopen (drft, "r")) == NULL) adios (drft, "unable to open"); if ((tmpfil = m_mktemp2(NULL, invo_name, NULL, &out)) == NULL) { - adios(NULL, "unable to create temporary file in %s", get_temp_dir()); + die("unable to create temporary file in %s", get_temp_dir()); } /* @@ -280,7 +280,7 @@ abort: break; default: - adios (NULL, "skeleton is poorly formatted"); + die("skeleton is poorly formatted"); } break; } diff --git a/uip/rcvdist.c b/uip/rcvdist.c index bf301cc2..eaa66bf6 100644 --- a/uip/rcvdist.c +++ b/uip/rcvdist.c @@ -85,7 +85,7 @@ main (int argc, char **argv) case FORMSW: if (!(form = *argp++) || *form == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; } } @@ -93,13 +93,13 @@ main (int argc, char **argv) } if (addrs == NULL) - adios (NULL, "usage: %s [switches] [switches for postproc] address ...", + die("usage: %s [switches] [switches for postproc] address ...", invo_name); umask (~m_gmprot ()); if ((tfile = m_mktemp2(NULL, invo_name, NULL, &fp)) == NULL) { - adios(NULL, "unable to create temporary file in %s", get_temp_dir()); + die("unable to create temporary file in %s", get_temp_dir()); } strncpy (tmpfil, tfile, sizeof(tmpfil)); @@ -107,7 +107,7 @@ main (int argc, char **argv) fseek (fp, 0L, SEEK_SET); if ((tfile = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) { - adios(NULL, "unable to create temporary file in %s", get_temp_dir()); + die("unable to create temporary file in %s", get_temp_dir()); } strncpy (drft, tfile, sizeof(tmpfil)); @@ -227,7 +227,7 @@ rcvdistout (FILE *inb, char *form, char *addrs) goto finished; default: - adios (NULL, "m_getfld2() returned %d", state); + die("m_getfld2() returned %d", state); } } finished: ; diff --git a/uip/rcvpack.c b/uip/rcvpack.c index ec1342e4..f6416673 100644 --- a/uip/rcvpack.c +++ b/uip/rcvpack.c @@ -54,7 +54,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] file", invo_name); @@ -73,12 +73,12 @@ main (int argc, char **argv) } } if (file) - adios (NULL, "only one file at a time!"); + die("only one file at a time!"); file = cp; } if (!file) - adios (NULL, "%s [switches] file", invo_name); + die("%s [switches] file", invo_name); rewind (stdin); diff --git a/uip/rcvstore.c b/uip/rcvstore.c index 02388188..a3f4d3cf 100644 --- a/uip/rcvstore.c +++ b/uip/rcvstore.c @@ -73,7 +73,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [switches]", @@ -86,7 +86,7 @@ main (int argc, char **argv) case SEQSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument name to %s", argp[-2]); + die("missing argument name to %s", argp[-2]); svector_push_back (seqs, cp); seqp++; @@ -123,10 +123,10 @@ main (int argc, char **argv) } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else { - adios (NULL, "usage: %s [+folder] [switches]", invo_name); + die("usage: %s [+folder] [switches]", invo_name); } } @@ -143,9 +143,9 @@ main (int argc, char **argv) if (errno != ENOENT) adios (maildir, "error on folder"); if (!create) - adios (NULL, "folder %s doesn't exist", maildir); + die("folder %s doesn't exist", maildir); if (!makedir (maildir)) - adios (NULL, "unable to create folder %s", maildir); + die("unable to create folder %s", maildir); } if (chdir (maildir) == NOTOK) @@ -160,7 +160,7 @@ main (int argc, char **argv) /* create a temporary file */ tmpfilenam = m_mktemp (invo_name, &fd, NULL); if (tmpfilenam == NULL) { - adios(NULL, "unable to create temporary file in %s", get_temp_dir()); + die("unable to create temporary file in %s", get_temp_dir()); } chmod (tmpfilenam, m_gmprot()); @@ -185,7 +185,7 @@ main (int argc, char **argv) * read folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* * Link message into folder, and possibly add diff --git a/uip/rcvtty.c b/uip/rcvtty.c index f1368f71..cb164b54 100644 --- a/uip/rcvtty.c +++ b/uip/rcvtty.c @@ -108,18 +108,18 @@ main (int argc, char **argv) case FORMSW: if (!(form = *argp++) || *form == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); format = NULL; continue; case FMTSW: if (!(format = *argp++) || *format == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); form = NULL; continue; case WIDTHSW: if (!(cp = *argp++) || *cp == '-') - adios(NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); width = atoi(cp); continue; case NLSW: diff --git a/uip/refile.c b/uip/refile.c index 3035f2c6..4cba2e1d 100644 --- a/uip/refile.c +++ b/uip/refile.c @@ -84,7 +84,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown\n", cp); + die("-%s unknown\n", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [msgs] [switches] +folder ...", @@ -125,29 +125,29 @@ main (int argc, char **argv) case SRCSW: if (folder) - adios (NULL, "only one source folder at a time!"); + die("only one source folder at a time!"); if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); folder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp, *cp != '@' ? TFOLDER : TSUBCWF); continue; case DRAFTSW: if (filep > NFOLDERS) - adios (NULL, "only %d files allowed!", NFOLDERS); + die("only %d files allowed!", NFOLDERS); isdf = 0; files[filep++] = mh_xstrdup(m_draft(NULL, NULL, 1, &isdf)); continue; case FILESW: if (filep > NFOLDERS) - adios (NULL, "only %d files allowed!", NFOLDERS); + die("only %d files allowed!", NFOLDERS); if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); files[filep++] = path (cp, TFILE); continue; case RPROCSW: if (!(rmmproc = *argp++) || *rmmproc == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case NRPRCSW: rmmproc = NULL; @@ -156,7 +156,7 @@ main (int argc, char **argv) } if (*cp == '+' || *cp == '@') { if (foldp > NFOLDERS) - adios (NULL, "only %d folders allowed!", NFOLDERS); + die("only %d folders allowed!", NFOLDERS); folders[foldp++].f_name = pluspath (cp); } else @@ -166,14 +166,14 @@ main (int argc, char **argv) if (!context_find ("path")) free (path ("./", TFOLDER)); if (foldp == 0) - adios (NULL, "no folder specified"); + die("no folder specified"); /* * We are refiling a file to the folders */ if (filep > 0) { if (folder || msgs.size) - adios (NULL, "use -file or some messages, not both"); + die("use -file or some messages, not both"); opnfolds (NULL, folders, foldp); for (i = 0; i < filep; i++) if (m_file (0, files[i], 0, folders, foldp, preserve, 0)) @@ -195,11 +195,11 @@ main (int argc, char **argv) /* read source folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse the message range/sequence/name and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) @@ -296,7 +296,7 @@ opnfolds (struct msgs *src_folder, struct st_fold *folders, int nfolders) if (chdir (nmaildir) == NOTOK) adios (nmaildir, "unable to change directory to"); if (!(mp = folder_read (fp->f_name, 1))) - adios (NULL, "unable to read folder %s", fp->f_name); + die("unable to read folder %s", fp->f_name); mp->curmsg = 0; fp->f_mp = mp; diff --git a/uip/repl.c b/uip/repl.c index 79a4522c..ca35a9d2 100644 --- a/uip/repl.c +++ b/uip/repl.c @@ -146,7 +146,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s: [+folder] [msg] [switches]", @@ -173,18 +173,18 @@ main (int argc, char **argv) case CCSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); docc (cp, 1); continue; case NCCSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); docc (cp, 0); continue; case EDITRSW: if (!(ed = *argp++) || *ed == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); nedit = 0; continue; case NEDITSW: @@ -196,10 +196,10 @@ main (int argc, char **argv) size_t i; if (!(type = *argp++)) { - adios (NULL, "missing type argument to %s", argp[-2]); + die("missing type argument to %s", argp[-2]); } if (!(cp = *argp++)) { - adios (NULL, "missing argstring argument to %s", + die("missing argstring argument to %s", argp[-3]); } @@ -221,7 +221,7 @@ main (int argc, char **argv) case WHATSW: if (!(whatnowproc = *argp++) || *whatnowproc == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); nwhat = 0; continue; case BILDSW: @@ -233,7 +233,7 @@ main (int argc, char **argv) case FCCSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); dp = NULL; if (*cp == '@') cp = dp = path (cp + 1, TSUBCWF); @@ -245,20 +245,20 @@ main (int argc, char **argv) case FILESW: if (file) - adios (NULL, "only one file at a time!"); + die("only one file at a time!"); if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); file = path (cp, TFILE); continue; case FILTSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); filter = mh_xstrdup(etcpath(cp)); mime = 0; continue; case FORMSW: if (!(form = *argp++) || *form == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case FRMTSW: @@ -293,24 +293,24 @@ main (int argc, char **argv) case WIDTHSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if ((outputlinelen = atoi (cp)) < 10) - adios (NULL, "impossible width %d", outputlinelen); + die("impossible width %d", outputlinelen); continue; case DFOLDSW: if (dfolder) - adios (NULL, "only one draft folder at a time!"); + die("only one draft folder at a time!"); if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp, *cp != '@' ? TFOLDER : TSUBCWF); continue; case DMSGSW: if (dmsg) - adios (NULL, "only one draft message at a time!"); + die("only one draft message at a time!"); if (!(dmsg = *argp++) || *dmsg == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case NDFLDSW: dfolder = NULL; @@ -326,7 +326,7 @@ main (int argc, char **argv) case FMTPROCSW: if (!(formatproc = *argp++) || *formatproc == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); fmtproc = 1; continue; case NFMTPROCSW: @@ -336,11 +336,11 @@ main (int argc, char **argv) } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else { if (msg) - adios (NULL, "only one message at a time!"); + die("only one message at a time!"); msg = cp; } } @@ -357,7 +357,7 @@ main (int argc, char **argv) if (!context_find ("path")) free (path ("./", TFOLDER)); if (file && (msg || folder)) - adios (NULL, "can't mix files and folders/msgs"); + die("can't mix files and folders/msgs"); try_it_again: @@ -413,11 +413,11 @@ try_it_again: /* read folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse the message range/sequence/name and set SELECTED */ if (!m_convert (mp, msg)) @@ -425,7 +425,7 @@ try_it_again: seq_setprev (mp); /* set the previous-sequence */ if (mp->numsel > 1) - adios (NULL, "only one message at a time!"); + die("only one message at a time!"); context_replace (pfolder, folder); /* update current folder */ seq_setcur (mp, mp->lowsel); /* update current message */ @@ -483,7 +483,7 @@ docc (char *cp, int ccflag) ambigsw (cp, ccswitches); done (1); case UNKWNSW: - adios (NULL, "-%scc %s unknown", ccflag ? "" : "no", cp); + die("-%scc %s unknown", ccflag ? "" : "no", cp); case CTOSW: ccto = ccflag; diff --git a/uip/replsbr.c b/uip/replsbr.c index 05997fdc..966744c0 100644 --- a/uip/replsbr.c +++ b/uip/replsbr.c @@ -149,7 +149,7 @@ replout (FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen, goto finished; default: - adios (NULL, "m_getfld2() returned %d", state); + die("m_getfld2() returned %d", state); } } diff --git a/uip/rmf.c b/uip/rmf.c index 406d9a61..6faaa4fe 100644 --- a/uip/rmf.c +++ b/uip/rmf.c @@ -52,7 +52,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [switches]", @@ -73,10 +73,10 @@ main (int argc, char **argv) } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else { - adios (NULL, "usage: %s [+folder] [switches]", invo_name); + die("usage: %s [+folder] [switches]", invo_name); } } @@ -88,7 +88,7 @@ main (int argc, char **argv) } fp = m_mailpath(folder); if (!strcmp(fp, pwd())) - adios (NULL, "sorry, you can't remove the current working directory"); + die("sorry, you can't remove the current working directory"); free(fp); if (interactive == -1) @@ -154,7 +154,7 @@ rmf (char *folder) } if ((dd = opendir (".")) == NULL) - adios (NULL, "unable to read folder +%s", folder); + die("unable to read folder +%s", folder); others = 0; /* diff --git a/uip/rmm.c b/uip/rmm.c index 104d5d2e..c49bf654 100644 --- a/uip/rmm.c +++ b/uip/rmm.c @@ -50,7 +50,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown\n", cp); + die("-%s unknown\n", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", @@ -70,7 +70,7 @@ main (int argc, char **argv) case RPROCSW: if (!(rmmproc = *argp++) || *rmmproc == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case NRPRCSW: rmmproc = NULL; @@ -79,7 +79,7 @@ main (int argc, char **argv) } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else app_msgarg(&msgs, cp); @@ -98,11 +98,11 @@ main (int argc, char **argv) /* read folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) diff --git a/uip/scan.c b/uip/scan.c index c9cf4ce3..592cc0a4 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -69,7 +69,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [+folder] [msgs] [switches]", @@ -89,12 +89,12 @@ main (int argc, char **argv) case FORMSW: if (!(form = *argp++) || *form == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); format = NULL; continue; case FMTSW: if (!(format = *argp++) || *format == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); form = NULL; continue; @@ -107,7 +107,7 @@ main (int argc, char **argv) case WIDTHSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); width = atoi (cp); continue; case REVSW: @@ -119,7 +119,7 @@ main (int argc, char **argv) case FILESW: if (!(cp = *argp++) || (cp[0] == '-' && cp[1])) - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if (strcmp (file = cp, "-")) file = path (cp, TFILE); continue; @@ -127,7 +127,7 @@ main (int argc, char **argv) } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else app_msgarg(&msgs, cp); @@ -146,9 +146,9 @@ main (int argc, char **argv) */ if (file) { if (msgs.size) - adios (NULL, "\"msgs\" not allowed with -file"); + die("\"msgs\" not allowed with -file"); if (folder) - adios (NULL, "\"+folder\" not allowed with -file"); + die("\"+folder\" not allowed with -file"); /* check if "file" is really stdin */ if (strcmp (file, "-") == 0) { @@ -193,11 +193,11 @@ main (int argc, char **argv) /* read folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) @@ -263,7 +263,7 @@ main (int argc, char **argv) break; default: - adios (NULL, "scan() botch (%d)", state); + die("scan() botch (%d)", state); case SCNEOF: inform("message %d: empty", msgnum); diff --git a/uip/scansbr.c b/uip/scansbr.c index ea5cf266..11646981 100644 --- a/uip/scansbr.c +++ b/uip/scansbr.c @@ -284,7 +284,7 @@ body:; goto finished; default: - adios (NULL, "getfld() returned %d", state); + die("getfld() returned %d", state); } } diff --git a/uip/send.c b/uip/send.c index 0546bf56..52fbbd1e 100644 --- a/uip/send.c +++ b/uip/send.c @@ -158,7 +158,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown\n", cp); + die("-%s unknown\n", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [file] [switches]", invo_name); @@ -174,15 +174,15 @@ main (int argc, char **argv) case DFOLDSW: if (dfolder) - adios (NULL, "only one draft folder at a time!"); + die("only one draft folder at a time!"); if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp, *cp != '@' ? TFOLDER : TSUBCWF); continue; case DMSGSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); msgs[msgp++] = cp; continue; case NDFLDSW: @@ -199,7 +199,7 @@ main (int argc, char **argv) case SPLITSW: if (!(cp = *argp++) || sscanf (cp, "%d", &splitsw) != 1) - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case UNIQSW: @@ -264,7 +264,7 @@ main (int argc, char **argv) case USERSW: vec[vecp++] = --cp; if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); vec[vecp++] = cp; user = cp; continue; @@ -272,15 +272,15 @@ main (int argc, char **argv) case AUTHSERVICESW: #ifdef OAUTH_SUPPORT if (!(auth_svc = *argp++) || *auth_svc == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); #else - adios (NULL, "not built with OAuth support"); + die("not built with OAuth support"); #endif continue; case SASLMECHSW: if (!(saslmech = *argp) || *saslmech == '-') - adios (NULL, "missing argument to %s", argp[-1]); + die("missing argument to %s", argp[-1]); /* FALLTHRU */ case ALIASW: @@ -294,7 +294,7 @@ main (int argc, char **argv) case MESSAGEIDSW: vec[vecp++] = --cp; if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); vec[vecp++] = cp; continue; } @@ -354,11 +354,11 @@ main (int argc, char **argv) /* read folder and create message structure */ if (!(mp = folder_read (dfolder, 1))) - adios (NULL, "unable to read folder %s", dfolder); + die("unable to read folder %s", dfolder); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", dfolder); + die("no messages in %s", dfolder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgp; msgnum++) @@ -402,7 +402,7 @@ go_to_it: && altmsg) { vec[vecp++] = "-dist"; if ((cp = m_mktemp2(altmsg, invo_name, NULL, NULL)) == NULL) { - adios(NULL, "unable to create temporary file"); + die("unable to create temporary file"); } distfile = mh_xstrdup(cp); (void) m_unlink(distfile); @@ -416,7 +416,7 @@ go_to_it: adios (distfile, "unable to link %s to", altmsg); free (distfile); if ((cp = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) { - adios(NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } distfile = mh_xstrdup(cp); @@ -441,11 +441,11 @@ go_to_it: #ifdef OAUTH_SUPPORT if (auth_svc == NULL) { if (saslmech && ! strcasecmp(saslmech, "xoauth2")) { - adios (NULL, "must specify -authservice with -saslmech xoauth2"); + die("must specify -authservice with -saslmech xoauth2"); } } else { if (user == NULL) { - adios (NULL, "must specify -user with -saslmech xoauth2"); + die("must specify -user with -saslmech xoauth2"); } } #else diff --git a/uip/sendsbr.c b/uip/sendsbr.c index c8a16a49..cc00e0ce 100644 --- a/uip/sendsbr.c +++ b/uip/sendsbr.c @@ -120,7 +120,7 @@ sendsbr (char **vec, int vecp, char *program, char *draft, struct stat *st, if (pushsw && unique) { char *cp = m_mktemp2(drft, invo_name, NULL, NULL); if (cp == NULL) { - adios(NULL, "unable to create temporary file"); + die("unable to create temporary file"); } if (rename (drft, strncpy(file, cp, sizeof(file))) == NOTOK) adios (file, "unable to rename %s to", drft); @@ -135,10 +135,10 @@ sendsbr (char **vec, int vecp, char *program, char *draft, struct stat *st, #ifdef OAUTH_SUPPORT const char *errmsg; if (setup_oauth_params(vec, nvecsp, auth_svc, &errmsg) != OK) { - adios(NULL, "%s", errmsg); + die("%s", errmsg); } #else - adios(NULL, "send built without OAUTH_SUPPORT, " + die("send built without OAUTH_SUPPORT, " "so auth_svc %s is not supported", auth_svc); #endif /* OAUTH_SUPPORT */ } @@ -276,17 +276,17 @@ splitmsg (char **vec, int vecp, char *program, char *drft, case LENERR: case FMTERR: - adios (NULL, "message format error in component #%d", compnum); + die("message format error in component #%d", compnum); default: - adios (NULL, "getfld () returned %d", state); + die("getfld () returned %d", state); } break; } m_getfld_state_destroy (&gstate); if (cp == NULL) - adios (NULL, "headers missing from draft"); + die("headers missing from draft"); nparts = 1; pos = start; @@ -329,7 +329,7 @@ splitmsg (char **vec, int vecp, char *program, char *drft, char *cp = m_mktemp2(drft, invo_name, NULL, &out); if (cp == NULL) { - adios(NULL, "unable to create temporary file"); + die("unable to create temporary file"); } strncpy(tmpdrf, cp, sizeof(tmpdrf)); @@ -362,7 +362,7 @@ splitmsg (char **vec, int vecp, char *program, char *drft, if (!fgets (buffer, sizeof buffer, in)) { if (partno == nparts) break; - adios (NULL, "premature eof"); + die("premature eof"); } if ((pos += (len = strlen (buffer))) > CPERMSG) { @@ -763,12 +763,12 @@ handle_sendfrom(char **vec, int *vecp, char *draft, const char *auth_svc) { if (strcmp(*vp, "xoauth2") == 0) { #ifdef OAUTH_SUPPORT if (setup_oauth_params(vec, vecp, auth_svc, &message) != OK) { - adios(NULL, "%s", message); + die("%s", message); } break; #else NMH_UNUSED(auth_svc); - adios(NULL, "send built without OAUTH_SUPPORT, " + die("send built without OAUTH_SUPPORT, " "so -saslmech xoauth2 is not supported"); #endif /* OAUTH_SUPPORT */ } @@ -816,7 +816,7 @@ setup_oauth_params(char *vec[], int *vecp, const char *auth_svc, if (saslmech && ! strcasecmp(saslmech, "xoauth2")) { if (! mh_oauth_get_service_info(auth_svc, &svc, errbuf, sizeof(errbuf))) - adios(NULL, "Unable to retrieve oauth profile entries: %s", + die("Unable to retrieve oauth profile entries: %s", errbuf); vec[(*vecp)++] = mh_xstrdup("-authservice"); diff --git a/uip/show.c b/uip/show.c index 130ccce8..5153ffb2 100644 --- a/uip/show.c +++ b/uip/show.c @@ -123,28 +123,27 @@ non_mhl_switches: case DRFTSW: if (file) - adios (NULL, "only one file at a time!"); + die("only one file at a time!"); draftsw++; if (mode == SHOW) continue; usage: - adios (NULL, - "usage: %s [+folder] [switches] [switches for showproc]", + die( "usage: %s [+folder] [switches] [switches for showproc]", invo_name); case FILESW: if (mode != SHOW) goto usage; if (draftsw || file) - adios (NULL, "only one file at a time!"); + die("only one file at a time!"); if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); file = path (cp, TFILE); continue; case FORMSW: app_msgarg(&vec, --cp); if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); app_msgarg(&vec, mh_xstrdup(etcpath(cp))); continue; @@ -160,13 +159,13 @@ usage: case WCACHESW: app_msgarg(&vec, --cp); if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); app_msgarg(&vec, cp); continue; case SHOWSW: if (!(showproc = *argp++) || *showproc == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); nshow = 0; continue; case NSHOWSW: @@ -175,7 +174,7 @@ usage: case SHOWMIMESW: if (!(showmimeproc = *argp++) || *showmimeproc == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); nshow = 0; continue; case CHECKMIMESW: @@ -188,7 +187,7 @@ usage: } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else { if (mode != SHOW) @@ -202,7 +201,7 @@ usage: if (draftsw || file) { if (msgs.size) - adios (NULL, "only one file at a time!"); + die("only one file at a time!"); if (draftsw) app_msgarg(&vec, mh_xstrdup(m_draft(folder, NULL, 1, &isdf))); else @@ -234,11 +233,11 @@ usage: /* read folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) diff --git a/uip/slocal.c b/uip/slocal.c index cfdc0dff..9f1d8a47 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -203,7 +203,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches]", invo_name); @@ -215,38 +215,38 @@ main (int argc, char **argv) case ADDRSW: if (!(addr = *argp++))/* allow -xyz arguments */ - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case INFOSW: if (!(info = *argp++))/* allow -xyz arguments */ - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case USERSW: if (!(user = *argp++))/* allow -xyz arguments */ - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case FILESW: if (!(file = *argp++) || *file == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case SENDERSW: if (!(sender = *argp++))/* allow -xyz arguments */ - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case MAILBOXSW: if (!(mbox = *argp++) || *mbox == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case HOMESW: if (!(home = *argp++) || *home == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case MAILSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); if (mdlvr) - adios (NULL, "only one maildelivery file at a time!"); + die("only one maildelivery file at a time!"); mdlvr = cp; continue; @@ -268,7 +268,7 @@ main (int argc, char **argv) continue; } } else { - adios (NULL, "only switch arguments are supported"); + die("only switch arguments are supported"); } } @@ -278,7 +278,7 @@ main (int argc, char **argv) user = getusername (); } if ((pw = getpwnam (user)) == NULL) - adios (NULL, "no such local user as %s", user); + die("no such local user as %s", user); if (chdir (pw->pw_dir) == -1) if (chdir ("/") < 0) { @@ -303,7 +303,7 @@ main (int argc, char **argv) /* Record the delivery time */ if ((now = dlocaltimenow ()) == NULL) - adios (NULL, "unable to ascertain local time"); + die("unable to ascertain local time"); snprintf (ddate, sizeof(ddate), "Delivery-Date: %s\n", dtimenow (0)); /* @@ -318,7 +318,7 @@ main (int argc, char **argv) if (debug) debug_printf ("retrieving message from file \"%s\"\n", file); if ((fd = copy_message (tempfd, tmpfil, 1)) == -1) - adios(NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); close (tempfd); } else { @@ -326,7 +326,7 @@ main (int argc, char **argv) if (debug) debug_printf ("retrieving message from stdin\n"); if ((fd = copy_message (fileno (stdin), tmpfil, 1)) == -1) - adios(NULL, "unable to create temporary file in %s", + die("unable to create temporary file in %s", get_temp_dir()); } @@ -347,7 +347,7 @@ main (int argc, char **argv) (void) m_unlink (tmpfil); if (!(fp = fdopen (fd, "r+"))) - adios (NULL, "unable to access temporary file"); + die("unable to access temporary file"); /* * If no sender given, extract it diff --git a/uip/sortm.c b/uip/sortm.c index 9d661f10..41652ece 100644 --- a/uip/sortm.c +++ b/uip/sortm.c @@ -93,7 +93,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf(buf, sizeof(buf), "%s [+folder] [msgs] [switches]", @@ -106,16 +106,16 @@ main (int argc, char **argv) case DATESW: if (datesw) - adios (NULL, "only one date field at a time"); + die("only one date field at a time"); if (!(datesw = *argp++) || *datesw == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case TEXTSW: if (subjsort) - adios (NULL, "only one text field at a time"); + die("only one text field at a time"); if (!(subjsort = *argp++) || *subjsort == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case SUBJSW: @@ -127,7 +127,7 @@ main (int argc, char **argv) case LIMSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); while (*cp == '0') cp++; /* skip any leading zeros */ if (!*cp) { /* hit end of string */ @@ -135,7 +135,7 @@ main (int argc, char **argv) continue; } if (!isdigit((unsigned char) *cp) || !(datelimit = atoi(cp))) - adios (NULL, "impossible limit %s", cp); + die("impossible limit %s", cp); datelimit *= 60*60*24; continue; case NLIMSW: @@ -167,7 +167,7 @@ main (int argc, char **argv) } if (*cp == '+' || *cp == '@') { if (folder) - adios (NULL, "only one folder at a time!"); + die("only one folder at a time!"); folder = pluspath (cp); } else app_msgarg(&msgs, cp); @@ -179,7 +179,7 @@ main (int argc, char **argv) if (allmsgs) { app_msgarg(&msgs, "all"); } else { - adios (NULL, "must specify messages to sort with -noall"); + die("must specify messages to sort with -noall"); } } if (!datesw) @@ -193,11 +193,11 @@ main (int argc, char **argv) /* read folder and create message structure */ if (!(mp = folder_read (folder, 1))) - adios (NULL, "unable to read folder %s", folder); + die("unable to read folder %s", folder); /* check for empty folder */ if (mp->nummsg == 0) - adios (NULL, "no messages in %s", folder); + die("no messages in %s", folder); /* parse all the message ranges/sequences and set SELECTED */ for (msgnum = 0; msgnum < msgs.size; msgnum++) @@ -206,10 +206,10 @@ main (int argc, char **argv) seq_setprev (mp); /* set the previous sequence */ if ((nmsgs = read_hdrs (mp, datesw)) <= 0) - adios (NULL, "no messages to sort"); + die("no messages to sort"); if (checksw && check_failed) { - adios (NULL, "errors found, no messages sorted"); + die("errors found, no messages sorted"); } /* @@ -397,7 +397,7 @@ get_fields (char *datesw, int msg, struct smsg *smsg) return 0; default: - adios (NULL, "internal error -- you lose"); + die("internal error -- you lose"); } break; } diff --git a/uip/viamail.c b/uip/viamail.c index f706dfd1..4bfd50c7 100644 --- a/uip/viamail.c +++ b/uip/viamail.c @@ -70,7 +70,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches]", invo_name); @@ -82,27 +82,27 @@ main (int argc, char **argv) case TOSW: if (!(f1 = *argp++)) - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case SUBJECTSW: if (!(f2 = *argp++)) - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case PARAMSW: if (!(f3 = *argp++)) - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case DESCRIPTSW: if (!(f4 = *argp++)) - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case COMMENTSW: if (!(f5 = *argp++)) - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case DELAYSW: if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); /* * If there is an error, just reset the delay parameter @@ -113,7 +113,7 @@ main (int argc, char **argv) continue; case FROMSW: if (!(f7 = *argp++)) - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case VERBSW: @@ -131,7 +131,7 @@ main (int argc, char **argv) } if (!f1) - adios (NULL, "missing -viamail \"mailpath\" switch"); + die("missing -viamail \"mailpath\" switch"); via_mail (f1, f2, f3, f4, f5, delay, f7); return 0; /* dead code to satisfy the compiler */ @@ -157,7 +157,7 @@ via_mail (char *mailsw, char *subjsw, char *parmsw, char *descsw, umask (~m_gmprot ()); if ((tfile = m_mktemp2(NULL, invo_name, NULL, &fp)) == NULL) { - adios(NULL, "unable to create temporary file in %s", get_temp_dir()); + die("unable to create temporary file in %s", get_temp_dir()); } strncpy (tmpfil, tfile, sizeof(tmpfil)); diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 9092f0e4..8b0b2ac7 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -154,7 +154,7 @@ WhatNow (int argc, char **argv) ambigsw (cp, whatnowswitches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] [file]", invo_name); @@ -166,17 +166,17 @@ WhatNow (int argc, char **argv) case DFOLDSW: if (dfolder) - adios (NULL, "only one draft folder at a time!"); + die("only one draft folder at a time!"); if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp, *cp != '@' ? TFOLDER : TSUBCWF); continue; case DMSGSW: if (dmsg) - adios (NULL, "only one draft message at a time!"); + die("only one draft message at a time!"); if (!(dmsg = *argp++) || *dmsg == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case NDFLDSW: dfolder = NULL; @@ -185,7 +185,7 @@ WhatNow (int argc, char **argv) case EDITRSW: if (!(ed = *argp++) || *ed == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); nedit = 0; continue; case NEDITSW: @@ -194,12 +194,12 @@ WhatNow (int argc, char **argv) case PRMPTSW: if (!(myprompt = *argp++) || *myprompt == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; } } if (drft) - adios (NULL, "only one draft at a time!"); + die("only one draft at a time!"); drft = cp; } @@ -551,7 +551,7 @@ writesomecmd(char *buf, int bufsz, char *cmd, char *trailcmd, char **argp) */ int trailln = strlen(trailcmd) + 4; if (ln < 0 || ln + trailln > bufsz) - adios(NULL, "arguments too long"); + die("arguments too long"); cp = buf + ln; @@ -559,7 +559,7 @@ writesomecmd(char *buf, int bufsz, char *cmd, char *trailcmd, char **argp) ln = strlen(*argp); /* +1 for leading space */ if (ln + trailln + 1 > bufsz - (cp-buf)) - adios(NULL, "arguments too long"); + die("arguments too long"); *cp++ = ' '; memcpy(cp, *argp, ln+1); cp += ln; @@ -1132,11 +1132,11 @@ sendit (char *sp, char **arg, char *file, int pushed) case AUTHSERVICESW: #ifdef OAUTH_SUPPORT if (!(auth_svc = *argp++) || *auth_svc == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); #else NMH_UNUSED (user); NMH_UNUSED (auth_svc); - adios (NULL, "not built with OAuth support"); + die("not built with OAuth support"); #endif continue; @@ -1205,7 +1205,7 @@ sendit (char *sp, char **arg, char *file, int pushed) && altmsg) { vec[vecp++] = "-dist"; if ((cp = m_mktemp2(altmsg, invo_name, NULL, NULL)) == NULL) { - adios(NULL, "unable to create temporary file"); + die("unable to create temporary file"); } distfile = mh_xstrdup(cp); (void) m_unlink(distfile); @@ -1218,11 +1218,11 @@ sendit (char *sp, char **arg, char *file, int pushed) #ifdef OAUTH_SUPPORT if (auth_svc == NULL) { if (saslmech && ! strcasecmp(saslmech, "xoauth2")) { - adios (NULL, "must specify -authservice with -saslmech xoauth2"); + die("must specify -authservice with -saslmech xoauth2"); } } else { if (user == NULL) { - adios (NULL, "must specify -user with -saslmech xoauth2"); + die("must specify -user with -saslmech xoauth2"); } } #else diff --git a/uip/whom.c b/uip/whom.c index b5935de9..34323820 100644 --- a/uip/whom.c +++ b/uip/whom.c @@ -92,7 +92,7 @@ main (int argc, char **argv) ambigsw (cp, switches); done (1); case UNKWNSW: - adios (NULL, "-%s unknown", cp); + die("-%s unknown", cp); case HELPSW: snprintf (buf, sizeof(buf), "%s [switches] [file]", invo_name); @@ -118,17 +118,17 @@ main (int argc, char **argv) case DFOLDSW: if (dfolder) - adios (NULL, "only one draft folder at a time!"); + die("only one draft folder at a time!"); if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); dfolder = path (*cp == '+' || *cp == '@' ? cp + 1 : cp, *cp != '@' ? TFOLDER : TSUBCWF); continue; case DMSGSW: if (dmsg) - adios (NULL, "only one draft message at a time!"); + die("only one draft message at a time!"); if (!(dmsg = *argp++) || *dmsg == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); continue; case NDFLDSW: dfolder = NULL; @@ -144,13 +144,13 @@ main (int argc, char **argv) case MTSSW: vec[vecp++] = --cp; if (!(cp = *argp++) || *cp == '-') - adios (NULL, "missing argument to %s", argp[-2]); + die("missing argument to %s", argp[-2]); vec[vecp++] = cp; continue; } } if (msg) - adios (NULL, "only one draft at a time!"); + die("only one draft at a time!"); vec[vecp++] = msg = cp; }