dav/finfo.c

changeset 852
83fdf679df99
parent 789
378b5ab86f77
equal deleted inserted replaced
850:bbe2925eb590 852:83fdf679df99
145 size_t x_values_size = 0; 145 size_t x_values_size = 0;
146 size_t x_values_alloc = 8; 146 size_t x_values_alloc = 8;
147 attributes->names = calloc(x_names_alloc, sizeof(char*)); 147 attributes->names = calloc(x_names_alloc, sizeof(char*));
148 attributes->values = calloc(x_values_alloc, sizeof(cxmutstr)); 148 attributes->values = calloc(x_values_alloc, sizeof(cxmutstr));
149 149
150 struct cx_array_reallocator_s re = { .realloc = array_realloc };
151 150
152 size_t count = 0; 151 size_t count = 0;
153 152
154 char *hash = NULL; 153 char *hash = NULL;
155 154
164 char *xname = strdup(xattr_name); 163 char *xname = strdup(xattr_name);
165 cx_array_copy( 164 cx_array_copy(
166 (void**)&attributes->names, 165 (void**)&attributes->names,
167 &x_names_size, 166 &x_names_size,
168 &x_names_alloc, 167 &x_names_alloc,
168 sizeof(size_t),
169 count, 169 count,
170 &xname, 170 &xname,
171 sizeof(void*), 171 sizeof(void*),
172 1, 172 1,
173 &re); 173 cx_array_default_reallocator);
174 174
175 char *text = dav_xml_getstring(node->children); 175 char *text = dav_xml_getstring(node->children);
176 if(!text) { 176 if(!text) {
177 text = ""; 177 text = "";
178 } 178 }
186 186
187 cx_array_copy( 187 cx_array_copy(
188 (void**)&attributes->values, 188 (void**)&attributes->values,
189 &x_values_size, 189 &x_values_size,
190 &x_values_alloc, 190 &x_values_alloc,
191 sizeof(size_t),
191 count, 192 count,
192 &value, 193 &value,
193 sizeof(cxmutstr), 194 sizeof(cxmutstr),
194 1, 195 1,
195 &re); 196 cx_array_default_reallocator);
196 197
197 count++; 198 count++;
198 } 199 }
199 } 200 }
200 } 201 }

mercurial