use strndup replacement on msvc
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7087 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
702633ccc4
commit
1f631718dd
|
@ -287,7 +287,11 @@ static inline void *zmalloc(size_t x)
|
|||
#define sqliteMallocRaw(x) malloc(x)//sqlite3MallocRaw(x,1)
|
||||
#define sqliteRealloc(x,y) realloc(x, y)//sqlite3Realloc(x,y)
|
||||
#define sqliteStrDup(x) strdup(x)//sqlite3StrDup(x)
|
||||
#ifdef _MSC_VER
|
||||
#define sqliteStrNDup(x,y) sqlite3StrNDup(x,y)
|
||||
#else
|
||||
#define sqliteStrNDup(x,y) strndup(x, y)//sqlite3StrNDup(x,y)
|
||||
#endif
|
||||
#define sqliteReallocOrFree(x,y) sqlite3ReallocOrFree(x,y)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -729,7 +729,7 @@ char *sqlite3StrDup(const char *z){
|
|||
char *sqlite3StrNDup(const char *z, int n){
|
||||
char *zNew;
|
||||
if( z==0 ) return 0;
|
||||
zNew = sqlite3MallocRaw(n+1, 1);
|
||||
zNew = sqliteMallocRaw(n+1, 1);
|
||||
if( zNew ){
|
||||
memcpy(zNew, z, n);
|
||||
zNew[n] = 0;
|
||||
|
|
Loading…
Reference in New Issue