File debug_fix.patch of Package openwsman.16236

diff --git a/include/u/carpal.h b/include/u/carpal.h
index fd49617b..653fef58 100644
--- a/include/u/carpal.h
+++ b/include/u/carpal.h
@@ -16,6 +16,7 @@
 
 
 #include <u/log.h>
+#include "./debug_internal.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/include/u/debug_internal.h b/include/u/debug_internal.h
index 03c000e6..6b59246b 100644
--- a/include/u/debug_internal.h
+++ b/include/u/debug_internal.h
@@ -52,8 +52,8 @@ struct _debug_handler_t {
 };
 typedef struct _debug_handler_t debug_handler_t;
 
-void debug_full(debug_level_e  level, const char *format, ...);
-void debug_full_verbose(debug_level_e  level, char *file,
+int debug_full(debug_level_e  level, const char *format, ...);
+int debug_full_verbose(debug_level_e  level, char *file,
                  int line, const char *proc, const char *format, ...);
 
 // #define ENABLE_TRACING
diff --git a/src/lib/u/debug.c b/src/lib/u/debug.c
index d647cd47..300d981d 100644
--- a/src/lib/u/debug.c
+++ b/src/lib/u/debug.c
@@ -106,13 +106,14 @@ static void call_handlers(debug_level_e level, char *str)
 }
 
 
-void debug_full(debug_level_e level, const char *format, ...)
+int debug_full(debug_level_e level, const char *format, ...)
 {
 	va_list args;
 	char *str;
+	int ret = 0;
 
 	if (handlers == NULL) {
-		return;
+		return -1;
 	}
 
 	va_start(args, format);
@@ -120,13 +121,15 @@ void debug_full(debug_level_e level, const char *format, ...)
 	va_end(args);
 
 	call_handlers(level, str);
+	ret = strlen(str);
 
 	u_free(str);
+	return ret;
 }
 
 
 
-void
+int
 debug_full_verbose(debug_level_e level,
 		   char *file,
 		   int line, const char *proc, const char *format, ...)
@@ -134,9 +137,10 @@ debug_full_verbose(debug_level_e level,
 	va_list args;
 	char *str;
 	char *body;
+	int ret = 0;
 
 	if (handlers == NULL) {
-		return;
+		return -1;
 	}
 
 	va_start(args, format);
@@ -147,6 +151,8 @@ debug_full_verbose(debug_level_e level,
 	u_free(body);
 
 	call_handlers(level, str);
+	ret = strlen(str);
 
 	u_free(str);
+	return ret;
 }
diff --git a/src/lib/u/uri.c b/src/lib/u/uri.c
index be5fe47e..e210ffc2 100644
--- a/src/lib/u/uri.c
+++ b/src/lib/u/uri.c
@@ -7,6 +7,7 @@ static const char rcsid[] =
 #ifdef HAVE_CONFIG_H
 #include <wsman_config.h>
 #endif
+#include <ctype.h>
 #include <stdlib.h>
 #include <string.h>
 
openSUSE Build Service is sponsored by