Clean up gcc-4.3 warnings
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10971 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
0a101fba3b
commit
3054ed120a
3 changed files with 7 additions and 3 deletions
|
|
@ -157,7 +157,9 @@ static const char *tmp_string(void)
|
||||||
gethostname(hostname, sizeof(hostname)-1);
|
gethostname(hostname, sizeof(hostname)-1);
|
||||||
#endif
|
#endif
|
||||||
hostname[sizeof(hostname)-1] = 0;
|
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;
|
return ret;
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ static void write_stats(int fd, unsigned counters[STATS_END])
|
||||||
if (len >= (int)sizeof(buf)-1) fatal("stats too long?!");
|
if (len >= (int)sizeof(buf)-1) fatal("stats too long?!");
|
||||||
|
|
||||||
lseek(fd, 0, SEEK_SET);
|
lseek(fd, 0, SEEK_SET);
|
||||||
write(fd, buf, len);
|
if (write(fd, buf, len) == -1) fatal("could not write stats");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -442,7 +442,9 @@ void x_asprintf(char **ptr, const char *format, ...)
|
||||||
|
|
||||||
*ptr = NULL;
|
*ptr = NULL;
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
vasprintf(ptr, format, ap);
|
if (vasprintf(ptr, format, ap) == -1) {
|
||||||
|
fatal("out of memory in x_asprintf");
|
||||||
|
}
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
if (!ptr) fatal("out of memory in x_asprintf");
|
if (!ptr) fatal("out of memory in x_asprintf");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue