]> git.evergreen-ils.org Git - Evergreen.git/blob - OpenSRF/src/libjson/ossupport.c
sort groups by name for consistancy
[Evergreen.git] / OpenSRF / src / libjson / ossupport.c
1 /*
2  * $Id$
3  *
4  * Copyright Marc Butler 2005.
5  * Marc Butler <marcbutler@acm.org>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public (LGPL)
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details: http://www.gnu.org/
16  *
17  */
18
19 #include <string.h>
20 #include <stdlib.h>
21 #include "ossupport.h"
22
23 #ifdef __APPLE_CC__
24 /**
25  * Synthesize strndup for MacOS X.
26  */
27 char * strndup(const char *s, size_t len)
28 {
29   char *copy = malloc(sizeof (char) * (len + 1));
30   strncpy(copy, s, len);
31   return copy;
32 }
33 #endif /* __APPLE_CC__ */