summaryrefslogtreecommitdiff
path: root/troff/troff.d/otfdump.c
diff options
context:
space:
mode:
Diffstat (limited to 'troff/troff.d/otfdump.c')
-rw-r--r--troff/troff.d/otfdump.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/troff/troff.d/otfdump.c b/troff/troff.d/otfdump.c
index cb6b7f940b765..283e6ae07d1d6 100644
--- a/troff/troff.d/otfdump.c
+++ b/troff/troff.d/otfdump.c
@@ -39,9 +39,9 @@ static void print(enum show, const char *, ...);
#define DUMP
#include <stdio.h>
+#include <unistd.h>
#include "otf.c"
#include "afm.c"
-#include "dpost.d/getopt.c"
#include <libgen.h>
@@ -109,7 +109,6 @@ dump(const char *name)
struct stat st;
FILE *fp;
char *cp;
- size_t l;
if ((fp = fopen(filename = name, "r")) == NULL) {
errprint("%s: cannot open", filename);
@@ -118,9 +117,7 @@ dump(const char *name)
memset(&A, 0, sizeof A);
a = &A;
a->file = a->path = (char *)filename;
- l = strlen(filename) + 1;
- a->base = malloc(l);
- n_strcpy(a->base, filename, l);
+ a->base = strdup(filename);
a->base = basename(a->base);
if ((cp = strrchr(a->base, '.')) != NULL)
*cp = '\0';