From: <bal...@us...> - 2004-02-11 22:39:07
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17560/gemrb/plugins/Core Modified Files: Core.cpp Log Message: Core.cpp / globals.h : - Added strndup() definitions for Win and FreeBSD Index: Core.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Core.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Core.cpp 1 Feb 2004 18:02:44 -0000 1.11 --- Core.cpp 11 Feb 2004 22:34:33 -0000 1.12 *************** *** 47,51 **** --- 47,53 ---- #include "../../includes/globals.h" + #ifndef WIN32 #include "Interface.h" + #endif #ifndef S_ISDIR *************** *** 85,88 **** --- 87,103 ---- //// Compatibility functions + #ifndef HAVE_STRNDUP + GEM_EXPORT char * strndup(const char * s, int l) + { + int len = strlen(s); + if(len < l) + l = len; + char * string = (char*)malloc(l+1); + strncpy(string, s, l); + string[l] = 0; + return string; + } + #endif + #ifdef WIN32 |