- if (NULL == (vbuf = malloc(p->rmargin)))
- err(1, "malloc");
-
- if (NULL == (pp = mdoc_vol2a(meta->vol))) {
- switch (meta->msec) {
- case (MSEC_1):
- /* FALLTHROUGH */
- case (MSEC_6):
- /* FALLTHROUGH */
- case (MSEC_7):
- pp = mdoc_vol2a(VOL_URM);
- break;
- case (MSEC_8):
- pp = mdoc_vol2a(VOL_SMM);
- break;
- case (MSEC_2):
- /* FALLTHROUGH */
- case (MSEC_3):
- /* FALLTHROUGH */
- case (MSEC_4):
- /* FALLTHROUGH */
- case (MSEC_5):
- pp = mdoc_vol2a(VOL_PRM);
- break;
- case (MSEC_9):
- pp = mdoc_vol2a(VOL_KM);
- break;
- default:
- break;
- }
- }
- vbuf[0] = 0;
-
- if (pp) {
- if (-1 == uname(&uts))
- err(1, "uname");
- (void)strlcat(vbuf, uts.sysname, p->rmargin);
- (void)strlcat(vbuf, " ", p->rmargin);
- } else if (NULL == (pp = mdoc_msec2a(meta->msec)))
- pp = mdoc_msec2a(MSEC_local);
-
- (void)strlcat(vbuf, pp, p->rmargin);