summaryrefslogtreecommitdiff
path: root/usr.sbin/bind/bin/dig/dig.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bind/bin/dig/dig.c')
-rw-r--r--usr.sbin/bind/bin/dig/dig.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bind/bin/dig/dig.c b/usr.sbin/bind/bin/dig/dig.c
index f2277abcbc1..73c14fb91ab 100644
--- a/usr.sbin/bind/bin/dig/dig.c
+++ b/usr.sbin/bind/bin/dig/dig.c
@@ -1387,10 +1387,10 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
INSIST(batchfp == NULL);
homedir = getenv("HOME");
if (homedir != NULL) {
- unsigned int n;
+ int n;
n = snprintf(rcfile, sizeof(rcfile), "%s/.digrc",
homedir);
- if (n < sizeof(rcfile))
+ if (n < sizeof(rcfile) && n != 0)
batchfp = fopen(rcfile, "r");
}
if (batchfp != NULL) {