Big refactor mostly builds. We now have a uniform backward compatible netconf.
This commit is contained in:
parent
b104bb4762
commit
e09c1a1c11
14 changed files with 738 additions and 795 deletions
|
@ -262,6 +262,24 @@ std::vector<std::string> Utils::split(const char *s,const char *const sep,const
|
|||
return fields;
|
||||
}
|
||||
|
||||
bool Utils::scopy(char *dest,unsigned int len,const char *src)
|
||||
{
|
||||
if (!len)
|
||||
return false; // sanity check
|
||||
if (!src) {
|
||||
*dest = (char)0;
|
||||
return true;
|
||||
}
|
||||
char *end = dest + len;
|
||||
while ((*dest++ = *src++)) {
|
||||
if (dest == end) {
|
||||
*(--dest) = (char)0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned int Utils::snprintf(char *buf,unsigned int len,const char *fmt,...)
|
||||
throw(std::length_error)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue