Added osgDB::stringcopy and stringcopyfixedsize
This commit is contained in:
@@ -487,6 +487,14 @@ std::string osgDB::getPathRelative(const std::string& from, const std::string& t
|
||||
return res;
|
||||
}
|
||||
|
||||
void osgDB::stringcopy(char* dest, const char* src, size_t length)
|
||||
{
|
||||
strncpy(dest, src, length-1);
|
||||
dest[length-1] = '\0';
|
||||
OSG_NOTICE<<"osgDB::stringcopy(["<<dest<<"], src=["<<src<<"], "<<length<<")"<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
//using namespace osgDB;
|
||||
//std::string testA = getPathRelative("C:\\a\\b", "C:\\a/b/d/f"); // d/f
|
||||
//std::string testB = getPathRelative("C:\\a\\d", "C:\\a/b/d/f"); // ../b/d/f
|
||||
|
||||
Reference in New Issue
Block a user