X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fsrwutil.c;fp=src%2Fsrwutil.c;h=493a7a34bd52df292f253817266788865542796f;hb=7fc72f3ae149e416a297ef1f55c09271056e98f1;hp=83665d413ad21c3b98180ffee42fd406e7fface1;hpb=5350317640042c3507172d28d14279595eb7a49f;p=yaz-moved-to-github.git diff --git a/src/srwutil.c b/src/srwutil.c index 83665d4..493a7a3 100644 --- a/src/srwutil.c +++ b/src/srwutil.c @@ -45,7 +45,7 @@ Z_AttributeElement *yaz_string_element_create(ODR o, int type, Z_AttributeElement *element = (Z_AttributeElement*) odr_malloc(o, sizeof(*element)); element->attributeType = odr_intdup(o, type); - element->attributeSet = odr_nullval(); + element->attributeSet = 0; element->which = Z_AttributeValue_complex; element->value.complex = (Z_ComplexAttribute *) odr_malloc(o, sizeof(Z_ComplexAttribute)); @@ -65,12 +65,11 @@ Z_AttributeList *yaz_use_attribute_create(ODR o, const char *name) { Z_AttributeList *attributes = (Z_AttributeList *) odr_malloc(o, sizeof(*attributes)); - Z_AttributeElement **elements = (Z_AttributeElement**) - odr_malloc(o, attributes->num_attributes * sizeof(*elements)); - elements[0] = yaz_string_element_create(o, 1, name); attributes->num_attributes = 1; - attributes->attributes = elements; + attributes->attributes = (Z_AttributeElement**) + odr_malloc(o, sizeof(*attributes->attributes)); + attributes->attributes[0] = yaz_string_element_create(o, 1, name); return attributes; }