aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-03 13:01:18 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-03 13:01:18 +0000
commit18a994a6bd010c8cc2aaf4ab71cac668456478f3 (patch)
treeabb46c31afc6ebcdf0fe23efebceddacd74b349a /main
parent45e15356337a46b7d541bbf4c86bdd2f2d329aa8 (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 'main')
-rw-r--r--main/file.c17
-rw-r--r--main/http.c31
-rw-r--r--main/utils.c7
3 files changed, 34 insertions, 21 deletions
diff --git a/main/file.c b/main/file.c
index 45a033c55..d891000f7 100644
--- a/main/file.c
+++ b/main/file.c
@@ -265,11 +265,18 @@ static char *build_filename(const char *filename, const char *ext)
if (!strcmp(ext, "wav49"))
ext = "WAV";
- if (filename[0] == '/')
- asprintf(&fn, "%s.%s", filename, ext);
- else
- asprintf(&fn, "%s/sounds/%s.%s",
- ast_config_AST_DATA_DIR, filename, ext);
+ if (filename[0] == '/') {
+ if (asprintf(&fn, "%s.%s", filename, ext) < 0) {
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ fn = NULL;
+ }
+ } else {
+ if (asprintf(&fn, "%s/sounds/%s.%s",
+ ast_config_AST_DATA_DIR, filename, ext) < 0) {
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ fn = NULL;
+ }
+ }
return fn;
}
diff --git a/main/http.c b/main/http.c
index e164d554f..cee1d913c 100644
--- a/main/http.c
+++ b/main/http.c
@@ -231,20 +231,23 @@ static struct ast_http_uri staticuri = {
char *ast_http_error(int status, const char *title, const char *extra_header, const char *text)
{
char *c = NULL;
- asprintf(&c,
- "Content-type: text/html\r\n"
- "%s"
- "\r\n"
- "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r\n"
- "<html><head>\r\n"
- "<title>%d %s</title>\r\n"
- "</head><body>\r\n"
- "<h1>%s</h1>\r\n"
- "<p>%s</p>\r\n"
- "<hr />\r\n"
- "<address>Asterisk Server</address>\r\n"
- "</body></html>\r\n",
- (extra_header ? extra_header : ""), status, title, title, text);
+ if (asprintf(&c,
+ "Content-type: text/html\r\n"
+ "%s"
+ "\r\n"
+ "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r\n"
+ "<html><head>\r\n"
+ "<title>%d %s</title>\r\n"
+ "</head><body>\r\n"
+ "<h1>%s</h1>\r\n"
+ "<p>%s</p>\r\n"
+ "<hr />\r\n"
+ "<address>Asterisk Server</address>\r\n"
+ "</body></html>\r\n",
+ (extra_header ? extra_header : ""), status, title, title, text) < 0) {
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ c = NULL;
+ }
return c;
}
diff --git a/main/utils.c b/main/utils.c
index 9749949e1..a802fd324 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -954,8 +954,11 @@ int ast_pthread_create_stack(pthread_t *thread, pthread_attr_t *attr, void *(*st
a->start_routine = start_routine;
a->data = data;
start_routine = dummy_start;
- asprintf(&a->name, "%-20s started at [%5d] %s %s()",
- start_fn, line, file, caller);
+ if (asprintf(&a->name, "%-20s started at [%5d] %s %s()",
+ start_fn, line, file, caller) < 0) {
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ a->name = NULL;
+ }
data = a;
}
#endif /* !LOW_MEMORY */