guard the private header
[reactos.git] / reactos / lib / crtdll / old cruft / mbstring / mbsdup.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/crtdll/mbstring/hanzen.c
5 * PURPOSE: Duplicates a multi byte string
6 * PROGRAMER: Boudewijn Dekker
7 * UPDATE HISTORY:
8 Modified from DJGPP strdup
9 * 12/04/99: Created
10 */
11
12 #include <msvcrt/mbstring.h>
13 #include <msvcrt/stdlib.h>
14
15 /*
16 * @implemented
17 */
18 unsigned char * _mbsdup(const unsigned char *_s)
19 {
20 char *rv;
21 if (_s == 0)
22 return 0;
23 rv = (char *)malloc(_mbslen(_s) + 1);
24 if (rv == 0)
25 return 0;
26 _mbscpy(rv, _s);
27 return rv;
28 }