Remove some clutter, and avoids direct call to fprintf().
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
if (!f)
return -1;
-#ifdef DEBUG
- fprintf(stderr, "IP address of your DNS(s): ");
-#endif
+ DEBUG_MISC("IP address of your DNS(s): ");
while (fgets(buff, 512, f) != NULL) {
if (sscanf(buff, "nameserver%*[ \t]%256s", buff2) == 1) {
char *c = strchr(buff2, '%');
*scope_id = if_index;
}
*cached_time = curtime;
+ } else {
+ DEBUG_MISC(", ");
}
-#ifdef DEBUG
- else
- fprintf(stderr, ", ");
-#endif
+
if (++found > 3) {
-#ifdef DEBUG
- fprintf(stderr, "(more)");
-#endif
+ DEBUG_MISC("(more)");
break;
}
#ifdef DEBUG
if (!res) {
res = "(string conversion error)";
}
- fprintf(stderr, "%s", res);
+ DEBUG_MISC("%s", res);
}
#endif
}