diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-03 13:01:18 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-03 13:01:18 +0000 |
commit | 18a994a6bd010c8cc2aaf4ab71cac668456478f3 (patch) | |
tree | abb46c31afc6ebcdf0fe23efebceddacd74b349a /pbx | |
parent | 45e15356337a46b7d541bbf4c86bdd2f2d329aa8 (diff) |
somehow missed a bunch of gcc 4.3.x warnings in this branch on the first pass
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@153823 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r-- | pbx/pbx_config.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c index 3314ac031..aa1d17d5c 100644 --- a/pbx/pbx_config.c +++ b/pbx/pbx_config.c @@ -723,10 +723,16 @@ static char *complete_context_remove_extension_deprecated(const char *line, cons if (++which > state) { /* If there is an extension then return exten@context. */ if (ast_get_extension_matchcid(e) && (!strchr(word, '@') || strchr(word, '/'))) { - asprintf(&ret, "%s/%s@%s", ast_get_extension_name(e), ast_get_extension_cidmatch(e), ast_get_context_name(c)); + if (asprintf(&ret, "%s/%s@%s", ast_get_extension_name(e), ast_get_extension_cidmatch(e), ast_get_context_name(c)) < 0) { + ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno)); + ret = NULL; + } break; } else if (!ast_get_extension_matchcid(e) && !strchr(word, '/')) { - asprintf(&ret, "%s@%s", ast_get_extension_name(e), ast_get_context_name(c)); + if (asprintf(&ret, "%s@%s", ast_get_extension_name(e), ast_get_context_name(c)) < 0) { + ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno)); + ret = NULL; + } break; } } @@ -863,10 +869,16 @@ static char *complete_context_remove_extension(const char *line, const char *wor if (++which > state) { /* If there is an extension then return exten@context. */ if (ast_get_extension_matchcid(e) && (!strchr(word, '@') || strchr(word, '/'))) { - asprintf(&ret, "%s/%s@%s", ast_get_extension_name(e), ast_get_extension_cidmatch(e), ast_get_context_name(c)); + if (asprintf(&ret, "%s/%s@%s", ast_get_extension_name(e), ast_get_extension_cidmatch(e), ast_get_context_name(c)) < 0) { + ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno)); + ret = NULL; + } break; } else if (!ast_get_extension_matchcid(e) && !strchr(word, '/')) { - asprintf(&ret, "%s@%s", ast_get_extension_name(e), ast_get_context_name(c)); + if (asprintf(&ret, "%s@%s", ast_get_extension_name(e), ast_get_context_name(c)) < 0) { + ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno)); + ret = NULL; + } break; } } |