X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=rset%2Frset.c;h=f64ff45c8b210bddb63fade93f20419641bf02ec;hb=27d70cebc8400fd364453a6bf9445531a66872d9;hp=6c298f7afbd19ca9484799efbcb9d2bdb39c5198;hpb=2c2827a0071c5a5511e1489c456ce64fdd42364a;p=idzebra-moved-to-github.git diff --git a/rset/rset.c b/rset/rset.c index 6c298f7..f64ff45 100644 --- a/rset/rset.c +++ b/rset/rset.c @@ -1,5 +1,5 @@ /* This file is part of the Zebra server. - Copyright (C) 2004-2013 Index Data + Copyright (C) Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -343,13 +343,11 @@ TERMID rset_term_create(const char *name, int length, const char *flags, zint hits_limit, const char *ref_id) { - TERMID t; - yaz_log (log_level, "term_create '%s' %d f=%s type=%d nmem=%p", - name, length, flags, type, nmem); - t= (TERMID) nmem_malloc(nmem, sizeof(*t)); + TERMID t = (TERMID) nmem_malloc(nmem, sizeof(*t)); + if (!name) - t->name = NULL; - else if (length == -1) + name = ""; + if (length == -1) t->name = nmem_strdup(nmem, name); else t->name = nmem_strdupn(nmem, name, length);