From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id d0cef046 for ; Tue, 9 Aug 2016 10:09:58 -0500 (EST) Date: Tue, 9 Aug 2016 10:09:58 -0500 (EST) Message-Id: <1955504386302869889.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: fix printf("%s", NULL); found while investigating an unrelated X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- fix printf("%s", NULL); found while investigating an unrelated bug report from jsg@ Modified Files: -------------- mdocml: main.c mdoc_validate.c Revision Data ------------- Index: mdoc_validate.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mdoc_validate.c,v retrieving revision 1.301 retrieving revision 1.302 diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.301 -r1.302 --- mdoc_validate.c +++ mdoc_validate.c @@ -1773,10 +1773,11 @@ post_sh_head(POST_ARGS) /* The NAME should be first. */ - if (SEC_NAME != sec && SEC_NONE == mdoc->lastnamed) + if (sec != SEC_NAME && mdoc->lastnamed == SEC_NONE) mandoc_vmsg(MANDOCERR_NAMESEC_FIRST, mdoc->parse, - mdoc->last->line, mdoc->last->pos, - "Sh %s", secnames[sec]); + mdoc->last->line, mdoc->last->pos, "Sh %s", + sec == SEC_CUSTOM ? mdoc->last->child->string : + secnames[sec]); /* The SYNOPSIS gets special attention in other areas. */ Index: main.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/main.c,v retrieving revision 1.274 retrieving revision 1.275 diff -Lmain.c -Lmain.c -u -p -r1.274 -r1.275 --- main.c +++ main.c @@ -985,7 +985,8 @@ mmsg(enum mandocerr t, enum mandoclevel { const char *mparse_msg; - fprintf(stderr, "%s: %s:", getprogname(), file); + fprintf(stderr, "%s: %s:", getprogname(), + file == NULL ? "" : file); if (line) fprintf(stderr, "%d:%d:", line, col + 1); -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv