X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fmatchstr.c;h=e2a1da3579ad5552623cc2dbc0d45b3bccf3b3cb;hp=3a319d33b0e3175f90deb993c59b4dce3b475d29;hb=8e9d2cec97def1cd8b89b1fe427f1a232661ec6f;hpb=8d691989077a0addcbd840d769dce6700f3d9622 diff --git a/src/matchstr.c b/src/matchstr.c index 3a319d3..e2a1da3 100644 --- a/src/matchstr.c +++ b/src/matchstr.c @@ -1,8 +1,6 @@ -/* - * Copyright (C) 1995-2007, Index Data ApS +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2008 Index Data * See the file LICENSE for details. - * - * $Id: matchstr.c,v 1.7 2007-01-03 08:42:15 adam Exp $ */ /** @@ -64,17 +62,15 @@ int yaz_strcmp_del(const char *a, const char *b, const char *b_del) return *a - *b; } -#ifdef __GNUC__ -#ifdef __CHECKER__ -void __assert_fail (const char *assertion, const char *file, - unsigned int line, const char *function) +int yaz_memcmp(const void *a, const void *b, size_t len_a, size_t len_b) { - fprintf (stderr, "%s in file %s line %d func %s\n", - assertion, file, line, function); - abort (); + size_t m_len = len_a < len_b ? len_a : len_b; + int r = memcmp(a, b, m_len); + if (r) + return r; + return len_a - len_b; } -#endif -#endif + /* * Local variables: * c-basic-offset: 4