typedef struct FNAME {
struct FNAME *fn_next;
- char fn_name[0];
} FNAME;
+#define FN_NAME(x) ((char *)((x) + 1))
+
FNAME *fnames;
char line[NLINE];
register FILE *fp;
for (fnp = fnames; fnp != NULL; fnp = fnp->fn_next)
- if (strcmp(fnp->fn_name, fname) == 0)
+ if (strcmp(FN_NAME(fnp), fname) == 0)
return (NULL);
if ((fp = fopen(fname, "r")) == NULL)
fprintf(stderr, "deroff: cannot open `%s'\n", fname);
NULL) {
fnp->fn_next = fnames;
fnames = fnp;
- strcpy(fnp->fn_name, fname);
+ strcpy(FN_NAME(fnp), fname);
}
return (fp);
}
ino_t t_ino;
unsigned short t_nlink;
struct link_t *t_next;
- char t_link[0];
} link_t;
+#define T_LINK(x) ((char *)(x + 1))
+
#define NHASH 64
link_t *linklist[NHASH];
lp->t_dev = dev;
lp->t_ino = ino;
lp->t_nlink = nlink;
- strcpy(lp->t_link, link);
+ strcpy(T_LINK(lp), link);
}
}
if (lp->t_ino == ino && lp->t_dev == dev) {
if (flag)
--lp->t_nlink;
- return (lp->t_link);
+ return (T_LINK(lp));
}
}
return (NULL);
fprintf(stderr,
"Tar: missed %d link%s to %s\n",
nlink, nlink == 1 ? "" : "s",
- lp->t_link);
+ T_LINK(lp));
}
}
}