char buf[BUFSIZE];
char* bufptr;
int to_write;
- ssize_t written;
+ size_t written;
int r;
to_write = SSL_read(ssl, buf, BUFSIZE);
}
bufptr = buf;
while (to_write > 0) {
- written = fwrite(bufptr, 1, to_write, file);
- if (written == -1) {
+ written = fwrite(bufptr, 1, (size_t)to_write, file);
+ if (written == 0) {
perror("fwrite");
return false;
}
}
bufptr = buf;
while (to_write > 0) {
- written = SSL_write(ssl, bufptr, to_write);
+ written = SSL_write(ssl, bufptr, (int)to_write);
if (written <= 0) {
- r = SSL_get_error(ssl, to_write);
+ r = SSL_get_error(ssl, (int)to_write);
if (r != SSL_ERROR_ZERO_RETURN) {
fprintf(stderr,
"writing SSL_get_error: %d\n", r);
return;
}
child = fork();
- if (child == -1) {
- perror("fork");
- return;
- } else if (child == 0) { /* Child process */
+ if (child == 0) { /* Child process */
close(pipefd[0]); /* close read end */
while (cp_line_from_file2fd_networkline(stdin, pipefd[1]));
close(pipefd[1]);
exit(EXIT_SUCCESS);
- } else { /* Parent process*/
+ } else if (child > 0) { /* Parent process*/
close(pipefd[1]); /* close write end */
maxfd = MAX(pipefd[0], sock) + 1;
for (;;) {
+#ifndef S_SPLINT_S
FD_ZERO(&rfds);
+#endif /* splint */
FD_SET(sock, &rfds);
FD_SET(pipefd[0], &rfds);
if (kill(child, SIGTERM) == -1) {
perror("kill");
}
+ } else {
+ perror("fork");
}
}
int ai_family = AF_UNSPEC;
int transport = LDNS_DANE_TRANSPORT_TCP;
- char* name_str;
+ char* name_str = NULL; /* supress uninitialized warning */
ldns_rdf* name;
- uint16_t port = 0; /* assignment to suppress
- * uninitialized warning
- */
+ uint16_t port = 0; /* supress uninitialized warning */
+
ldns_resolver* res = NULL;
ldns_rdf* tlsa_owner = NULL;
char* tlsa_owner_str = NULL;