aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_iconv.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-16 02:44:49 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-16 02:44:49 +0000
commit040609f7b5461bdd67e800aa18ad43bd590ac2e5 (patch)
tree767971c134a4187d3e8f44d2a228139ccf855582 /funcs/func_iconv.c
parent64eacde3d225798405a517c8b78f8bab4244e73f (diff)
Cast the 2nd argument to iconv() to a void *, as some systems define it as a
(const char *), while others define it as (char *). This is done to suppress compiler warnings about it. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75163 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_iconv.c')
-rw-r--r--funcs/func_iconv.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/funcs/func_iconv.c b/funcs/func_iconv.c
index cc7294c6c..1bce3c66a 100644
--- a/funcs/func_iconv.c
+++ b/funcs/func_iconv.c
@@ -47,6 +47,13 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/app.h"
#include "asterisk/options.h"
+/*!
+ * Some systems define the second arg to iconv() as (const char *),
+ * while others define it as (char *). Cast it to a (void *) to
+ * suppress compiler warnings about it.
+ */
+#define AST_ICONV_CAST void *
+
static int iconv_read(struct ast_channel *chan, const char *cmd, char *arguments, char *buf, size_t len)
{
AST_DECLARE_APP_ARGS(args,
@@ -82,7 +89,7 @@ static int iconv_read(struct ast_channel *chan, const char *cmd, char *arguments
return -1;
}
- if (iconv(cd, &args.text, &incount, &buf, &outcount) == (size_t) -1) {
+ if (iconv(cd, (AST_ICONV_CAST) &args.text, &incount, &buf, &outcount) == (size_t) -1) {
if (errno == E2BIG)
ast_log(LOG_WARNING, "Iconv: output buffer too small.\n");
else if (errno == EILSEQ)