From 755f4f12f4c480e96b04a4808ed030f6ea67961d Mon Sep 17 00:00:00 2001 From: ehofman Date: Sun, 21 Jun 2009 11:09:32 +0000 Subject: [PATCH] add some debugig logic --- utils/xmlgrep/generic-config-analyse.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/utils/xmlgrep/generic-config-analyse.c b/utils/xmlgrep/generic-config-analyse.c index 1e8ffeb47..3cb09c9f5 100644 --- a/utils/xmlgrep/generic-config-analyse.c +++ b/utils/xmlgrep/generic-config-analyse.c @@ -99,14 +99,19 @@ void print_binary_protocol(void *id, char *filename, char *dir) size = 4; } else if (!strcasecmp(type, "double")) { size = 8; - } else { /* defaults to integer */ + } else if (!strcasecmp(type, "int")) { size = 4; + } else { + printf("Unsupported type sepcified: '%s'\n\n", type); + free(type); + free(xid); + return; } - xmlNodeCopyString(xid, "factor", (char *)factor, 10); + xmlNodeCopyString(xid, "factor", (char *)&factor, 10); name = xmlNodeGetString(xid, "name"); - printf("%4i | %4i | %6s | %10s | %s\n", pos, size, type, factor?factor:"", name); + printf("%4i | %4i | %6s | %10s | %s\n", pos, size, type, factor, name); pos += size; free(type);