summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ctm
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1996-11-21 15:17:04 +0000
committerphk <phk@FreeBSD.org>1996-11-21 15:17:04 +0000
commit85056a35fa958257c515f18ec5a191cd17913a73 (patch)
treee8fc522e27748a0afea5b8936345924ff77a53b7 /usr.sbin/ctm
parent3bbde75bec510a5ab5dbd525d8bcd7ef0afe6335 (diff)
downloadFreeBSD-src-85056a35fa958257c515f18ec5a191cd17913a73.zip
FreeBSD-src-85056a35fa958257c515f18ec5a191cd17913a73.tar.gz
Don't dump core on zero-size files.
Diffstat (limited to 'usr.sbin/ctm')
-rw-r--r--usr.sbin/ctm/mkCTM/mkctm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ctm/mkCTM/mkctm.c b/usr.sbin/ctm/mkCTM/mkctm.c
index 94540da..24c3aaa 100644
--- a/usr.sbin/ctm/mkCTM/mkctm.c
+++ b/usr.sbin/ctm/mkCTM/mkctm.c
@@ -219,7 +219,7 @@ Equ(const char *dir1, const char *dir2, const char *name, struct dirent *de)
int j;
FILE *F;
- if (p1[s1.st_size-1] != '\n') {
+ if (s1.st_size && p1[s1.st_size-1] != '\n') {
if (verbose > 0)
fprintf(stderr,
"last char != \\n in %s\n",
@@ -227,7 +227,7 @@ Equ(const char *dir1, const char *dir2, const char *name, struct dirent *de)
goto subst;
}
- if (p2[s2.st_size-1] != '\n') {
+ if (s2.st_size && p2[s2.st_size-1] != '\n') {
if (verbose > 0)
fprintf(stderr,
"last char != \\n in %s\n",
OpenPOWER on IntegriCloud