X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/035c5db3403da8a955b2c8f525076f89de9f2713..7711f3fc00259e55f630cfe6104eff3083dc9d77:/uip/send.c diff --git a/uip/send.c b/uip/send.c index 3ba82fb5..5885c98e 100644 --- a/uip/send.c +++ b/uip/send.c @@ -118,13 +118,7 @@ main (int argc, char **argv) struct msgs *mp; struct stat st; -#ifdef LOCALE - setlocale(LC_ALL, ""); -#endif - invo_name = r1bindex (argv[0], '/'); - - /* read user profile/context */ - context_read(); + if (nmh_init(argv[0], 1)) { return 1; } arguments = getarguments (invo_name, argc, argv, 1); argp = arguments; @@ -384,8 +378,12 @@ go_to_it: && (distsw = atoi (cp)) && altmsg) { vec[vecp++] = "-dist"; - distfile = getcpy (m_mktemp2 (altmsg, invo_name, NULL, NULL)); - unlink(distfile); + if ((cp = m_mktemp2(altmsg, invo_name, NULL, NULL)) == NULL) { + adios(NULL, "unable to create temporary file in %s", + get_temp_dir()); + } + distfile = getcpy (cp); + (void) m_unlink(distfile); if (link (altmsg, distfile) == NOTOK) { /* Cygwin with FAT32 filesystem produces EPERM. */ if (errno != EXDEV && errno != EPERM @@ -395,7 +393,11 @@ go_to_it: ) adios (distfile, "unable to link %s to", altmsg); free (distfile); - distfile = getcpy (m_mktemp2(NULL, invo_name, NULL, NULL)); + if ((cp = m_mktemp2(NULL, invo_name, NULL, NULL)) == NULL) { + adios(NULL, "unable to create temporary file in %s", + get_temp_dir()); + } + distfile = getcpy (cp); { int in, out; struct stat st;