diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-12-02 00:57:31 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-12-02 00:57:31 +0000 |
commit | f1d490bac29b47dc6ea7799f1faeaf1563cd04eb (patch) | |
tree | 8b0b03098d8001bd7d9737d84e3350d5f58d1c03 /main/pbx.c | |
parent | 01b53f1cd1b3e9617ca5c7386f3a2ace8f923e3e (diff) |
Merged revisions 160208 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r160208 | tilghman | 2008-12-01 18:37:21 -0600 (Mon, 01 Dec 2008) | 10 lines
Merged revisions 160207 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r160207 | tilghman | 2008-12-01 18:25:16 -0600 (Mon, 01 Dec 2008) | 3 lines
Ensure that Asterisk builds with --enable-dev-mode, even on the latest gcc
and glibc.
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@160228 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/pbx.c')
-rw-r--r-- | main/pbx.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/main/pbx.c b/main/pbx.c index 835218043..4c8f23caf 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -6347,14 +6347,19 @@ int ast_context_add_ignorepat2(struct ast_context *con, const char *value, const { struct ast_ignorepat *ignorepat, *ignorepatc, *ignorepatl = NULL; int length; + char *pattern; length = sizeof(struct ast_ignorepat); length += strlen(value) + 1; if (!(ignorepat = ast_calloc(1, length))) return -1; /* The cast to char * is because we need to write the initial value. - * The field is not supposed to be modified otherwise + * The field is not supposed to be modified otherwise. Also, gcc 4.2 + * sees the cast as dereferencing a type-punned pointer and warns about + * it. This is the workaround (we're telling gcc, yes, that's really + * what we wanted to do). */ - strcpy((char *)ignorepat->pattern, value); + pattern = (char *) ignorepat->pattern; + strcpy(pattern, value); ignorepat->next = NULL; ignorepat->registrar = registrar; ast_wrlock_context(con); |