diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2008-12-07 10:57:43 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2008-12-07 10:57:43 +0000 |
commit | 3054ed120a0363007c607ac6c20458ec2d5bd183 (patch) | |
tree | e10aa8e53e949eca1bba2117b2ba833b6fb76086 /CCache | |
parent | 0a101fba3bf3a961a35f8b89ae034d7381f036dd (diff) | |
download | swig-3054ed120a0363007c607ac6c20458ec2d5bd183.tar.gz |
Clean up gcc-4.3 warnings
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10971 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'CCache')
-rw-r--r-- | CCache/ccache.c | 4 | ||||
-rw-r--r-- | CCache/stats.c | 2 | ||||
-rw-r--r-- | CCache/util.c | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/CCache/ccache.c b/CCache/ccache.c index 9b12d3bf7..3d5f13633 100644 --- a/CCache/ccache.c +++ b/CCache/ccache.c @@ -157,7 +157,9 @@ static const char *tmp_string(void) gethostname(hostname, sizeof(hostname)-1); #endif hostname[sizeof(hostname)-1] = 0; - asprintf(&ret, "%s.%u", hostname, (unsigned)getpid()); + if (asprintf(&ret, "%s.%u", hostname, (unsigned)getpid()) == -1) { + fatal("could not allocate tmp_string"); + } } return ret; diff --git a/CCache/stats.c b/CCache/stats.c index 8be1879d1..f87264794 100644 --- a/CCache/stats.c +++ b/CCache/stats.c @@ -91,7 +91,7 @@ static void write_stats(int fd, unsigned counters[STATS_END]) if (len >= (int)sizeof(buf)-1) fatal("stats too long?!"); lseek(fd, 0, SEEK_SET); - write(fd, buf, len); + if (write(fd, buf, len) == -1) fatal("could not write stats"); } diff --git a/CCache/util.c b/CCache/util.c index 06b290954..8e39b9c21 100644 --- a/CCache/util.c +++ b/CCache/util.c @@ -442,7 +442,9 @@ void x_asprintf(char **ptr, const char *format, ...) *ptr = NULL; va_start(ap, format); - vasprintf(ptr, format, ap); + if (vasprintf(ptr, format, ap) == -1) { + fatal("out of memory in x_asprintf"); + } va_end(ap); if (!ptr) fatal("out of memory in x_asprintf"); |