aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/mingw/libsrc/wspiapi/WspiapiStrdup.c
blob: 220de872d600b9a76ee975c87fbd2cc70dabd9c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#undef  __CRT__NO_INLINE
#define __CRT__NO_INLINE
#include <winsock2.h>
#include <wspiapi.h>

char * WINAPI
WspiapiStrdup (const char *pszString)
{
  char *rstr;
  size_t szlen;

  if(!pszString)
    return NULL;
  szlen = strlen(pszString) + 1;
  rstr = (char *) WspiapiMalloc (szlen);
  if (!rstr)
    return NULL;
  strcpy (rstr, pszString);
  return rstr;
}