projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changed type to avoid warning
[yaz-moved-to-github.git]
/
src
/
matchstr.c
diff --git
a/src/matchstr.c
b/src/matchstr.c
index
3a319d3
..
4c3bcf2
100644
(file)
--- a/
src/matchstr.c
+++ b/
src/matchstr.c
@@
-1,13
+1,11
@@
-/*
- * 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.
* See the file LICENSE for details.
- *
- * $Id: matchstr.c,v 1.7 2007-01-03 08:42:15 adam Exp $
*/
/**
* \file matchstr.c
*/
/**
* \file matchstr.c
- * \brief Implements loose string matching
+ * \brief a couple of string utilities
*/
#if HAVE_CONFIG_H
*/
#if HAVE_CONFIG_H
@@
-18,7
+16,7
@@
#include <assert.h>
#include <ctype.h>
#include <string.h>
#include <assert.h>
#include <ctype.h>
#include <string.h>
-#include <yaz/yaz-util.h>
+#include <yaz/matchstr.h>
int yaz_matchstr(const char *s1, const char *s2)
{
int yaz_matchstr(const char *s1, const char *s2)
{
@@
-64,17
+62,15
@@
int yaz_strcmp_del(const char *a, const char *b, const char *b_del)
return *a - *b;
}
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
/*
* Local variables:
* c-basic-offset: 4