diff options
Diffstat (limited to 'src/utils.c')
-rw-r--r-- | src/utils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c index c9e7089..b961f70 100644 --- a/src/utils.c +++ b/src/utils.c @@ -85,6 +85,8 @@ utGetDomainInfo(char **szDefDomain, char **szDefServer) return 1; *szDefDomain = calloc(257, sizeof(char)); memcpy(*szDefDomain, _res.defdname, 256); + if (strnlen(*szDefDomain, 256) == 0) + *szDefDomain[0] = '-'; *szDefServer = calloc(IFNAMSIZ, sizeof(char)); memcpy(*szDefServer, inet_ntoa(_res.nsaddr_list[0].sin_addr), IFNAMSIZ-1); res_close(); |