X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=lttv%2Flttv%2Fattribute.c;h=1a8cbafe733631fad63487b9d28197d17d8b34a5;hb=b9ce0bad7daf7c0a2333c91fdb1e35d602afe17f;hp=80126a5e167eb1c717c856a8888be03f2e54ec96;hpb=90e19f82bca635a1ba52b8a50b64e484bd19c14f;p=lttv.git diff --git a/lttv/lttv/attribute.c b/lttv/lttv/attribute.c index 80126a5e..1a8cbafe 100644 --- a/lttv/lttv/attribute.c +++ b/lttv/lttv/attribute.c @@ -12,8 +12,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H @@ -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 *