X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/177f020f122827214159c46dcfe7ded1e3c8d1c3..ea1fd31a3d41352b024fb35a1a781dce6a2f7afe:/sbr/mime_type.c diff --git a/sbr/mime_type.c b/sbr/mime_type.c index 395c10cc..f1b96fe5 100644 --- a/sbr/mime_type.c +++ b/sbr/mime_type.c @@ -8,6 +8,7 @@ #include #include #include +#include "mime_type.h" #ifdef MIMETYPEPROC static char *get_file_info(const char *, const char *); @@ -68,7 +69,7 @@ mime_type(const char *file_name) { if ((p = strrchr(file_name, '.')) != NULL) { for (np = m_defs; np; np = np->n_next) { if (strncasecmp(np->n_name, "mhshow-suffix-", 14) == 0 && - strcasecmp(p, np->n_field ? np->n_field : "") == 0) { + strcasecmp(p, FENDNULL(np->n_field)) == 0) { content_type = strdup(np->n_name + 14); break; } @@ -131,7 +132,7 @@ get_file_info(const char *proc, const char *file_name) { FILE *fp; if ((fp = popen(cmd, "r")) != NULL) { - char buf[BUFSIZ >= 2048 ? BUFSIZ : 2048]; + char buf[max(BUFSIZ, 2048)]; buf[0] = '\0'; if (fgets(buf, sizeof buf, fp)) {