projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace lookup tables for obscure hashes with more readable code
[mmh]
/
uip
/
mhlistsbr.c
diff --git
a/uip/mhlistsbr.c
b/uip/mhlistsbr.c
index
08f35c7
..
dd6264b
100644
(file)
--- a/
uip/mhlistsbr.c
+++ b/
uip/mhlistsbr.c
@@
-14,6
+14,8
@@
#include <h/mime.h>
#include <h/mhparse.h>
#include <h/utils.h>
#include <h/mime.h>
#include <h/mhparse.h>
#include <h/utils.h>
+#include <sys/stat.h>
+#include <sysexits.h>
/* mhmisc.c */
int part_ok(CT, int);
/* mhmisc.c */
int part_ok(CT, int);
@@
-116,7
+118,7
@@
list_switch(CT ct, int toplevel, int verbose, int debug)
default:
/* list_debug (ct); */
default:
/* list_debug (ct); */
- adios(NULL, "unknown content type %d", ct->c_type);
+ adios(EX_DATAERR, NULL, "unknown content type %d", ct->c_type);
break;
}
break;
}
@@
-172,11
+174,10
@@
list_content(CT ct, int toplevel, int verbose, int debug)
/* print Content-Description */
if (ct->c_descr) {
char *dp;
/* print Content-Description */
if (ct->c_descr) {
char *dp;
-
- dp = trimcpy(cp = getcpy(ct->c_descr));
- free(cp);
+ dp = trimcpy(cp = mh_xstrdup(ct->c_descr));
+ mh_free0(&cp);
printf(LSTFMT2d1, dp);
printf(LSTFMT2d1, dp);
- free(dp);
+ mh_free0(&dp);
}
printf("\n");
}
printf("\n");
@@
-199,7
+200,7
@@
list_content(CT ct, int toplevel, int verbose, int debug)
dp = trimcpy(cp = add(ci->ci_comment, NULL));
free (cp);
snprintf(buffer, sizeof(buffer), "(%s)", dp);
dp = trimcpy(cp = add(ci->ci_comment, NULL));
free (cp);
snprintf(buffer, sizeof(buffer), "(%s)", dp);
- free(dp);
+ mh_free0(&dp);
printf(LSTFMT2d2, buffer);
}
}
printf(LSTFMT2d2, buffer);
}
}