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