2 * Copyright 2003-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
12 strdup(const char *string
)
17 // unlike the standard strdup() function, the BeOS implementation
18 // handles NULL strings gracefully
22 length
= strlen(string
) + 1;
24 if ((copied
= (char *)malloc(length
)) == NULL
)
27 memcpy(copied
, string
, length
);