diff --git a/drill/drill.c b/drill/drill.c index 44c1b768..9db77cf1 100644 --- a/drill/drill.c +++ b/drill/drill.c @@ -855,7 +855,7 @@ main(int argc, char *argv[]) status = ldns_send_buffer(&pkt, res, query_buffer, NULL); ldns_buffer_free(query_buffer); if (status != LDNS_STATUS_OK) { - printf("Error: %s\n", ldns_get_errorstr_by_id(status)); + fprintf(stderr, "Error: %s\n", ldns_get_errorstr_by_id(status)); exit(1); } } else { diff --git a/examples/ldns-walk.c b/examples/ldns-walk.c index f320b99d..d7f84595 100644 --- a/examples/ldns-walk.c +++ b/examples/ldns-walk.c @@ -323,7 +323,7 @@ main(int argc, char *argv[]) /* create a new resolver from /etc/resolv.conf */ if(!serv) { if (ldns_resolver_new_frm_file(&res, NULL) != LDNS_STATUS_OK) { - fprintf(stderr, "%s", "Could not create resolver obj"); + fprintf(stderr, "%s\n", "Could not create resolver obj."); result = EXIT_FAILURE; goto exit; } @@ -344,7 +344,7 @@ main(int argc, char *argv[]) status = ldns_resolver_new_frm_file(&cmdline_res, NULL); if (status != LDNS_STATUS_OK) { - fprintf(stderr, "%s", "@server ip could not be converted"); + fprintf(stderr, "%s\n", "@server ip could not be converted"); result = EXIT_FAILURE; goto exit; } @@ -358,7 +358,7 @@ main(int argc, char *argv[]) ldns_rdf_deep_free(cmdline_dname); ldns_resolver_deep_free(cmdline_res); if (!cmdline_rr_list) { - fprintf(stderr, "%s %s", "could not find any address for the name: ", serv); + fprintf(stderr, "%s %s\n", "Could not find any address for the name:", serv); result = EXIT_FAILURE; goto exit; } else { @@ -366,7 +366,7 @@ main(int argc, char *argv[]) res, cmdline_rr_list ) != LDNS_STATUS_OK) { - fprintf(stderr, "%s", "pushing nameserver"); + fprintf(stderr, "%s\n", "pushing nameserver"); result = EXIT_FAILURE; ldns_rr_list_deep_free(cmdline_rr_list); goto exit; @@ -375,7 +375,7 @@ main(int argc, char *argv[]) } } else { if (ldns_resolver_push_nameserver(res, serv_rdf) != LDNS_STATUS_OK) { - fprintf(stderr, "%s", "pushing nameserver"); + fprintf(stderr, "%s\n", "pushing nameserver"); result = EXIT_FAILURE; goto exit; } else { @@ -569,7 +569,7 @@ main(int argc, char *argv[]) if (!rrlist) { fflush(stdout); fprintf(stderr, "Zone does not seem to be DNSSEC secured," - "or it uses NSEC3.\n"); + " or it uses NSEC3.\n"); fflush(stderr); goto exit; } diff --git a/masterdont/server.c b/masterdont/server.c index a78ec6c2..e0f13f34 100644 --- a/masterdont/server.c +++ b/masterdont/server.c @@ -240,23 +240,23 @@ handle_listen(struct server_info_t *sinfo, struct socket_service* listen_v) int newfd; if(sinfo->num_tcp >= MAX_TCP) { - printf("Error: incoming tcp query, but MAX_TCP reached (%d)\n", + fprintf(stderr, "Error: incoming tcp query, but MAX_TCP reached (%d)\n", MAX_TCP); return; } if((newfd=accept(listen_v->s, NULL, NULL)) == -1) { - printf("Error tcp accept: %s", strerror(errno)); + fprintf(stderr, "Error tcp accept: %s", strerror(errno)); return; } if(fcntl(newfd, F_SETFL, O_NONBLOCK) == -1) { - printf("Error fcntl: %s\n", strerror(errno)); + fprintf(stderr, "Error fcntl: %s\n", strerror(errno)); close(newfd); return; } sh = (struct socket_service*)malloc(sizeof(struct socket_service)); if(!sh) { - printf("out of memory\n"); + fprintf(stderr, "malloc: %s\n", strerror(errno)); close(newfd); return; }