h->data_used = dl;
h->data = p;
- h->fully_sorted = 0;
+ /* This assumes you only loadHeader() something you unloadHeader()-ed */
+ h->fully_sorted = 1;
h->mutable = 0;
return h;
{
void *p;
int_32 *pi;
+ Header res;
pi = p = malloc(2 * sizeof(int_32) +
h->entries_used * sizeof(struct indexEntry) +
pi += h->entries_used * sizeof(struct indexEntry);
memcpy(pi, h->data, h->data_used);
+ res = copyHeader(p);
+ free(p);
+
return p;
}
/* Fall through to STRING_ARRAY_TYPE */
case STRING_ARRAY_TYPE:
/* Correction! */
- *type = STRING_ARRAY_TYPE;
+ if (type) {
+ *type = STRING_ARRAY_TYPE;
+ }
/* Otherwise, build up an array of char* to return */
x = index->count;
*p = malloc(x * sizeof(char *));