iostream: Fix ast_iostream_printf declaration.

This adds the printf attribute and changes 'fmt' from 'const void *' to
'const char *'.  This resolves a warning from some compiler for
vsnprintf needing a literal string for format.

Change-Id: I71c33a8262590042ee451e1146760c10bb22fb78
This commit is contained in:
Corey Farrell
2017-11-18 20:50:48 -05:00
parent 4181b6f377
commit b4862e463c
2 changed files with 3 additions and 2 deletions

View File

@@ -109,7 +109,8 @@ ssize_t ast_iostream_read(struct ast_iostream *stream, void *buf, size_t count);
ssize_t ast_iostream_gets(struct ast_iostream *stream, char *buf, size_t count);
ssize_t ast_iostream_discard(struct ast_iostream *stream, size_t count);
ssize_t ast_iostream_write(struct ast_iostream *stream, const void *buf, size_t count);
ssize_t ast_iostream_printf(struct ast_iostream *stream, const void *fmt, ...);
ssize_t __attribute__((format(printf, 2, 3))) ast_iostream_printf(
struct ast_iostream *stream, const char *fmt, ...);
struct ast_iostream* ast_iostream_from_fd(int *fd);
int ast_iostream_start_tls(struct ast_iostream **stream, SSL_CTX *ctx, int client);

View File

@@ -443,7 +443,7 @@ ssize_t ast_iostream_write(struct ast_iostream *stream, const void *buf, size_t
}
}
ssize_t ast_iostream_printf(struct ast_iostream *stream, const void *fmt, ...)
ssize_t ast_iostream_printf(struct ast_iostream *stream, const char *fmt, ...)
{
char sbuf[512], *buf = sbuf;
int len, len2, ret = -1;