Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
746 B

//=======================================================================
//
// Copyright (c) 1998-1999 Microsoft Corporation. All Rights Reserved.
//
// File: string.cpp
//
// Purpose:
//
//=======================================================================
#include <windows.h>
#include <v3stdlib.h>
const char* strcpystr(const char* pszStr, const char* pszSep, char* pszTokOut)
{
if (pszStr == NULL || *pszStr == '\0')
{
pszTokOut[0] = '\0';
return NULL;
}
const char* p = strstr(pszStr, pszSep);
if (p != NULL)
{
strncpy(pszTokOut, pszStr, p - pszStr);
pszTokOut[p - pszStr] = '\0';
return p + strlen(pszSep);
}
else
{
strcpy(pszTokOut, pszStr);
return NULL;
}
}