Use consistent integer types and formats

This commit is contained in:
Jeremy Lakeman 2013-09-09 12:09:40 +09:30
parent f0a74e6cf2
commit d1234cb0f9
3 changed files with 7 additions and 7 deletions

View File

@ -486,7 +486,7 @@ static int _load_decode_hex(const char **hex, unsigned char **buf, size_t *len)
return -1;
}
else if (hexlen != *len)
return WHYF("invalid hex value, incorrect length (expecting %u bytes, got %u)", *len, hexlen);
return WHYF("invalid hex value, incorrect length (expecting %zu bytes, got %zu)", *len, hexlen);
strn_fromhex(*buf, *len, *hex, hex);
assert(*hex == end);
return 0;
@ -966,7 +966,7 @@ static keyring_identity *keyring_unpack_identity(unsigned char *slot, const char
}
if (keypair_len > rotbuf_remain(&rbuf)) {
if (config.debug.keyring)
DEBUGF("invalid keypair length %u", keypair_len);
DEBUGF("invalid keypair length %zu", keypair_len);
keyring_free_identity(id);
return NULL;
}

6
log.c
View File

@ -238,7 +238,7 @@ static void _log_prefix(_log_iterator *it, int level)
if (strftime(buf, sizeof buf, "%T", &it->tm) == 0)
xputs("EMPTYTIME___ ", it->xpf);
else
xprintf(it->xpf, "%s.%03u ", buf, it->tv.tv_usec / 1000);
xprintf(it->xpf, "%s.%03u ", buf, (unsigned int)it->tv.tv_usec / 1000);
}
}
}
@ -667,7 +667,7 @@ void logString(int level, struct __sourceloc whence, const char *str)
_log_iterator_rewind(&it);
while (_log_iterator_next(&it, level)) {
_log_prefix_whence(&it, whence);
xprintf(it.xpf, "%.*s", p - s, s);
xprintf(it.xpf, "%.*s", (int)(p - s), s);
}
s = p + 1;
}
@ -676,7 +676,7 @@ void logString(int level, struct __sourceloc whence, const char *str)
_log_iterator_rewind(&it);
while (_log_iterator_next(&it, level)) {
_log_prefix_whence(&it, whence);
xprintf(it.xpf, "%.*s", p - s, s);
xprintf(it.xpf, "%.*s", (int)(p - s), s);
}
}
}

View File

@ -199,9 +199,9 @@ struct decode_context;
typedef struct keypair {
int type;
unsigned char *private_key;
unsigned private_key_len;
size_t private_key_len;
unsigned char *public_key;
unsigned public_key_len;
size_t public_key_len;
} keypair;
/* Contains just the list of private:public key pairs and types,