Fix compiler warnings.

This commit is contained in:
Guus Sliepen 2011-07-13 22:52:52 +02:00
parent 791c1898ea
commit 303dd1e702
3 changed files with 7 additions and 7 deletions

View file

@ -155,7 +155,7 @@ bool send_metakey_ec(connection_t *c) {
b64encode(key, key, ECDH_SIZE + siglen);
bool result = send_request(c, "%d %s", METAKEY, key);
return send_request(c, "%d %s", METAKEY, key);
}
bool send_metakey(connection_t *c) {

View file

@ -198,7 +198,7 @@ bool ans_key_h(connection_t *c, char *request) {
int cipher, digest, maclength, compression, keylen;
node_t *from, *to;
if(sscanf(request, "%*d "MAX_STRING" "MAX_STRING" "MAX_STRING" %d %d %d %d "MAX_STRING" "MAX_STRING" %d",
if(sscanf(request, "%*d "MAX_STRING" "MAX_STRING" "MAX_STRING" %d %d %d %d "MAX_STRING" "MAX_STRING,
from_name, to_name, key, &cipher, &digest, &maclength,
&compression, address, port) < 7) {
logger(LOG_ERR, "Got bad %s from %s (%s)", "ANS_KEY", c->name,

View file

@ -405,14 +405,14 @@ bool recvdata(int fd, char *data, size_t len) {
bool sendline(int fd, char *format, ...) {
static char buffer[4096];
char *p = buffer;
size_t blen = 0;
int blen = 0;
va_list ap;
va_start(ap, format);
blen = vsnprintf(buffer, sizeof buffer, format, ap);
va_end(ap);
if(blen < 0 || blen >= sizeof buffer)
if(blen < 1 || blen >= sizeof buffer)
return false;
buffer[blen] = '\n';
@ -422,7 +422,7 @@ bool sendline(int fd, char *format, ...) {
int result = send(fd, p, blen, 0);
if(result == -1 && errno == EINTR)
continue;
else if(result <= 0);
else if(result <= 0)
return false;
p += result;
blen -= result;
@ -574,7 +574,7 @@ int main(int argc, char *argv[], char *envp[]) {
struct addrinfo *res = NULL;
if(getaddrinfo(host, port, &hints, &res) || !res) {
fprintf(stderr, "Cannot resolve %s port %s: %s", host ?: "localhost", port, strerror(errno));
fprintf(stderr, "Cannot resolve %s port %s: %s", host, port, strerror(errno));
return 1;
}
@ -593,7 +593,7 @@ int main(int argc, char *argv[], char *envp[]) {
#endif
if(connect(fd, res->ai_addr, res->ai_addrlen) < 0) {
fprintf(stderr, "Cannot connect to %s port %s: %s\n", host ?: "localhost", port, sockstrerror(sockerrno));
fprintf(stderr, "Cannot connect to %s port %s: %s\n", host, port, sockstrerror(sockerrno));
return 1;
}