X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/efa36b8cb2aae4cf57dde5118888ae2d4f78e2cd..ad098559d2ee9ed3c176be7d33e6583a573ffc96:/uip/whatnowsbr.c?ds=sidebyside diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 80386e95..088ca242 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -216,7 +216,7 @@ WhatNow (int argc, char **argv) if ((drft == NULL && (drft = getenv ("mhdraft")) == NULL) || *drft == 0) drft = getcpy (m_draft (dfolder, dmsg, 1, &isdf)); - msgnam = (cp = getenv ("mhaltmsg")) && *cp ? getcpy (cp) : NULL; + msgnam = (cp = getenv ("mhaltmsg")) && *cp ? mh_xstrdup(cp) : NULL; if ((cp = getenv ("mhatfile")) && *cp) atfile = atoi(cp); @@ -328,10 +328,7 @@ WhatNow (int argc, char **argv) if (fgets(cwd, sizeof (cwd), f) == NULL) { advise (buf, "fgets"); } - - if (strchr(cwd, '\n') != (char *)0) - *strchr(cwd, '\n') = '\0'; - + TrimSuffixC(cwd, '\n'); pclose(f); } else { @@ -438,7 +435,7 @@ WhatNow (int argc, char **argv) while (fgets(shell, sizeof (shell), f) != (char *)0) { char *ctype; - *(strchr(shell, '\n')) = '\0'; + TrimSuffixC(shell, '\n'); if (*shell == '/') { strncpy(file, shell, sizeof(file)); @@ -523,7 +520,7 @@ WhatNow (int argc, char **argv) writelscmd(buf, sizeof(buf), "-d --", argp); if ((f = popen_in_dir(cwd, buf, "r")) != (FILE *)0) { while (fgets(shell, sizeof (shell), f) != (char *)0) { - *(strchr(shell, '\n')) = '\0'; + TrimSuffixC(shell, '\n'); annotate(drft, ATTACH_FIELD, shell, 1, 0, 0, 1); } pclose(f); @@ -947,7 +944,6 @@ buildfile (char **argp, char *file) X("nodraftfolder", 0, SNDRFSW) \ X("sasl", SASLminc(4), SASLSW) \ X("nosasl", SASLminc(6), NOSASLSW) \ - X("saslmaxssf", SASLminc(10), SASLMXSSFSW) \ X("saslmech", SASLminc(5), SASLMECHSW) \ X("authservice", SASLminc(0), AUTHSERVICESW) \ X("user username", SASLminc(4), USERSW) \ @@ -1165,7 +1161,6 @@ sendit (char *sp, char **arg, char *file, int pushed) case WIDTHSW: case CLIESW: case SERVSW: - case SASLMXSSFSW: case USERSW: case PORTSW: case MTSSM: @@ -1209,7 +1204,7 @@ sendit (char *sp, char **arg, char *file, int pushed) if ((cp = context_find ("Aliasfile"))) { char **ap, *dp; - dp = getcpy (cp); + dp = mh_xstrdup(cp); for (ap = brkstring (dp, " ", "\n"); ap && *ap; ap++) { vec[vecp++] = "-alias"; vec[vecp++] = *ap; @@ -1238,7 +1233,7 @@ sendit (char *sp, char **arg, char *file, int pushed) adios(NULL, "unable to create temporary file in %s", get_temp_dir()); } - distfile = getcpy (cp); + distfile = mh_xstrdup(cp); (void) m_unlink(distfile); if (link (altmsg, distfile) == NOTOK) adios (distfile, "unable to link %s to", altmsg);