diff options
author | Jeremy Allison <jra@samba.org> | 2008-12-31 16:30:11 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2008-12-31 16:30:11 -0800 |
commit | bb23f5725f538d14b2ccec0463cfb1136be3ebd0 (patch) | |
tree | 392ffa5f6e85aa85ee05c7fbdd0dbeaee8aee5cc /source3/script | |
parent | d99aeed50f1221561d8d935777216d372a2a4a71 (diff) | |
download | samba-bb23f5725f538d14b2ccec0463cfb1136be3ebd0.tar.gz samba-bb23f5725f538d14b2ccec0463cfb1136be3ebd0.tar.bz2 samba-bb23f5725f538d14b2ccec0463cfb1136be3ebd0.zip |
Fix more asprintf and "ignoring return code" warnings from gcc 4.3.
Jeremy.
Diffstat (limited to 'source3/script')
-rw-r--r-- | source3/script/mkbuildoptions.awk | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source3/script/mkbuildoptions.awk b/source3/script/mkbuildoptions.awk index 02562cf7b2..a1e5d85061 100644 --- a/source3/script/mkbuildoptions.awk +++ b/source3/script/mkbuildoptions.awk @@ -23,29 +23,31 @@ BEGIN { print "#include \"build_env.h\""; print "#include \"dynconfig.h\""; print ""; - print "static void output(bool screen, const char *format, ...) PRINTF_ATTRIBUTE(2,3);"; + print "static int output(bool screen, const char *format, ...) PRINTF_ATTRIBUTE(2,3);"; print "void build_options(bool screen);"; print ""; print ""; print "/****************************************************************************"; print "helper function for build_options"; print "****************************************************************************/"; - print "static void output(bool screen, const char *format, ...)"; + print "static int output(bool screen, const char *format, ...)"; print "{"; - print " char *ptr;"; + print " char *ptr = NULL;"; + print " int ret = 0;"; print " va_list ap;"; print " "; print " va_start(ap, format);"; - print " vasprintf(&ptr,format,ap);"; + print " ret = vasprintf(&ptr,format,ap);"; print " va_end(ap);"; print ""; print " if (screen) {"; - print " d_printf(\"%s\", ptr);"; + print " d_printf(\"%s\", ptr ? ptr : \"\");"; print " } else {"; - print " DEBUG(4,(\"%s\", ptr));"; + print " DEBUG(4,(\"%s\", ptr ? ptr : \"\"));"; print " }"; print " "; print " SAFE_FREE(ptr);"; + print " return ret;"; print "}"; print ""; print "/****************************************************************************"; |