]> git.sur5r.net Git - openldap/blob - libraries/liblber/assert.c
Use memcmp not strncmp for non-string comparisons.
[openldap] / libraries / liblber / assert.c
1 /*
2  * Copyright 1999 The OpenLDAP Foundation, Redwood City, California, USA
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted only
6  * as authorized by the OpenLDAP Public License.  A copy of this
7  * license is available at http://www.OpenLDAP.org/license.html or
8  * in file LICENSE in the top-level directory of the distribution.
9  */
10
11 #include "portable.h"
12
13 #ifdef LDAP_NEED_ASSERT
14
15 #include <ac/stdio.h>
16
17 /*
18  * helper for our private assert() macro
19  *
20  * note: if assert() doesn't exist, like abort() or raise() won't either.
21  * could use kill() but that might be problematic.  I'll just ignore this
22  * issue for now.
23  */
24
25 void ber_pvt_assert(char* file, int line, char* test)
26 {
27         fprintf(stderr,
28                 "Assertion failed: %s, file %s, line %d\n",
29                         test, file, line);
30
31         abort();
32 }
33
34 #endif