X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fsortspec.c;h=7e0f7fc080c3092cb67f407a649de7299c7bf1bc;hp=3ea0dcb01a905b8f95e121190e22146df1879a6b;hb=03dccce903176e61f889b1558834aa5a09f9f8c0;hpb=ff4dc282083d2c1920329cd6e7406a10669494dd diff --git a/src/sortspec.c b/src/sortspec.c index 3ea0dcb..7e0f7fc 100644 --- a/src/sortspec.c +++ b/src/sortspec.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2011 Index Data + * Copyright (C) 1995-2012 Index Data * See the file LICENSE for details. */ /** @@ -23,7 +23,7 @@ Z_SortKeySpecList *yaz_sort_spec(ODR out, const char *arg) { char sort_string_buf[64], sort_flags[64]; Z_SortKeySpecList *sksl = (Z_SortKeySpecList *) - odr_malloc (out, sizeof(*sksl)); + odr_malloc(out, sizeof(*sksl)); int off; sksl->num_specs = 0; @@ -41,7 +41,7 @@ Z_SortKeySpecList *yaz_sort_spec(ODR out, const char *arg) arg += off; sksl->specs[sksl->num_specs++] = sks; sks->sortElement = (Z_SortElement *) - odr_malloc (out, sizeof(*sks->sortElement)); + odr_malloc(out, sizeof(*sks->sortElement)); sks->sortElement->which = Z_SortElement_generic; sks->sortElement->u.generic = sk; @@ -60,7 +60,7 @@ Z_SortKeySpecList *yaz_sort_spec(ODR out, const char *arg) while (i < 10 && sort_string && sort_string_sep) { Z_AttributeElement *el = (Z_AttributeElement *) - odr_malloc (out, sizeof(*el)); + odr_malloc(out, sizeof(*el)); sk->u.sortAttributes->list->attributes[i] = el; el->attributeSet = 0; el->attributeType = odr_intdup(out, atoi(sort_string)); @@ -123,7 +123,7 @@ Z_SortKeySpecList *yaz_sort_spec(ODR out, const char *arg) sks->u.missingValueData->size = sks->u.missingValueData->len; sks->u.missingValueData->buf = (unsigned char*) odr_strdup(out, sort_flags+i); - i += strlen(sort_flags+i); + i += strlen(sort_flags+i) - 1; } } }