projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
don't try to malloc 0 bytes if an RFC2047 encoded block is empty
[mmh]
/
uip
/
mshcmds.c
diff --git
a/uip/mshcmds.c
b/uip/mshcmds.c
index
3548b7e
..
63ee99c
100644
(file)
--- a/
uip/mshcmds.c
+++ b/
uip/mshcmds.c
@@
-21,8
+21,8
@@
#include <signal.h>
#include <h/msh.h>
#include <h/picksbr.h>
#include <signal.h>
#include <h/msh.h>
#include <h/picksbr.h>
+#include <h/utils.h>
-extern int errno;
static char delim3[] = "-------"; /* from burst.c */
static char delim3[] = "-------"; /* from burst.c */
@@
-2161,8
+2161,7
@@
scancmd (char **args)
if (*dp == '\\' || *dp == '"' || *dp == '\n')
i++;
i++;
if (*dp == '\\' || *dp == '"' || *dp == '\n')
i++;
i++;
- if ((ep = malloc ((unsigned) i)) == NULL)
- adios (NULL, "out of memory");
+ ep = mh_xmalloc ((unsigned) i);
for (dp = nfs, fp = ep; *dp; dp++) {
if (*dp == '\n') {
*fp++ = '\\', *fp++ = 'n';
for (dp = nfs, fp = ep; *dp; dp++) {
if (*dp == '\n') {
*fp++ = '\\', *fp++ = 'n';
@@
-3009,7
+3008,6
@@
process (int msgnum, char *proc, int vecp, char **vec)
strncpy (tmpfil, m_scratch ("", invo_name), sizeof(tmpfil));
if ((out = fopen (tmpfil, "w")) == NULL) {
int olderr;
strncpy (tmpfil, m_scratch ("", invo_name), sizeof(tmpfil));
if ((out = fopen (tmpfil, "w")) == NULL) {
int olderr;
- extern int errno;
char newfil[80];
olderr = errno;
char newfil[80];
olderr = errno;