X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=lttv%2Flttv%2Fattribute.c;h=57c6d33285e930a668bac8996bea3eb62f0714bc;hb=190724cdfc53eeebfd895b594f875b53a72adf37;hp=80126a5e167eb1c717c856a8888be03f2e54ec96;hpb=90e19f82bca635a1ba52b8a50b64e484bd19c14f;p=lttv.git diff --git a/lttv/lttv/attribute.c b/lttv/lttv/attribute.c index 80126a5e..57c6d332 100644 --- a/lttv/lttv/attribute.c +++ b/lttv/lttv/attribute.c @@ -22,8 +22,7 @@ #include #include -#include -#include +#include typedef union _AttributeValue { int dv_int; @@ -50,7 +49,7 @@ typedef struct _Attribute { static __inline__ LttvAttributeValue address_of_value(LttvAttributeType t, AttributeValue *v) { - LttvAttributeValue va; + LttvAttributeValue va = { NULL }; /* init to NULL for gcc */ switch(t) { case LTTV_INT: va.v_int = &v->dv_int; break; @@ -487,13 +486,15 @@ lttv_attribute_read_xml(LttvAttribute *self, FILE *fp) LttvAttribute *subtree; - fscanf(fp,""); + res = fscanf(fp, ""); + g_assert(res > 0); while(1) { res = fscanf(fp, "]", buffer, type); g_assert(res == 2); name = g_quark_from_string(buffer); if(strcmp(type, "ATTRS") == 0) { - fscanf(fp, ">"); + res = fscanf(fp, ">"); + g_assert(res > 0); subtree = lttv_attribute_find_subdir(self, name); lttv_attribute_read_xml(subtree, fp); } @@ -553,11 +554,13 @@ lttv_attribute_read_xml(LttvAttribute *self, FILE *fp) } else if(strcmp(type, "NONE") == 0) { value = lttv_attribute_add(self, name, LTTV_NONE); - fscanf(fp, "/>"); + res = fscanf(fp, "/>"); + g_assert(res > 0); } else g_error("Unknown type to read"); } - fscanf(fp,""); + res = fscanf(fp, ""); + g_assert(res > 0); } static LttvAttribute *