diff options
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 "/****************************************************************************"; |