Fixed gcc warnings on openbsd. - mrash/fwknop#60

This commit is contained in:
Franck Joncourt
2013-05-14 22:08:44 +02:00
parent 9dbb62ae1e
commit bb90a8bf75
7 changed files with 126 additions and 88 deletions
+3 -3
View File
@@ -118,7 +118,7 @@ fko_encode_spa_data(fko_ctx_t ctx)
/* Add the timestamp.
*/
offset = strlen(tbuf);
sprintf(((char*)tbuf+offset), ":%u:", (unsigned int) ctx->timestamp);
snprintf(((char*)tbuf+offset), FKO_ENCODE_TMP_BUF_SIZE - offset, ":%u:", (unsigned int) ctx->timestamp);
/* Add the version string.
*/
@@ -138,7 +138,7 @@ fko_encode_spa_data(fko_ctx_t ctx)
/* Add the message type value.
*/
offset = strlen(tbuf);
sprintf(((char*)tbuf+offset), ":%i:", ctx->message_type);
snprintf(((char*)tbuf+offset), FKO_ENCODE_TMP_BUF_SIZE - offset, ":%i:", ctx->message_type);
/* Add the base64-encoded SPA message.
*/
@@ -180,7 +180,7 @@ fko_encode_spa_data(fko_ctx_t ctx)
if(ctx->client_timeout > 0 && ctx->message_type != FKO_COMMAND_MSG)
{
offset = strlen(tbuf);
sprintf(((char*)tbuf+offset), ":%i", ctx->client_timeout);
snprintf(((char*)tbuf+offset), FKO_ENCODE_TMP_BUF_SIZE - offset, ":%i", ctx->client_timeout);
}
/* If encoded_msg is not null, then we assume it needs to