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.
24 lines
458 B
24 lines
458 B
#include "str_attr.hh"
|
|
#include <stdlib.h>
|
|
|
|
namespace pEp {
|
|
namespace utility {
|
|
using namespace std;
|
|
|
|
void str_attr(char *&str, string value)
|
|
{
|
|
free(str);
|
|
str = strdup(value.c_str());
|
|
if (!str)
|
|
throw bad_alloc();
|
|
}
|
|
|
|
string str_attr(char *&str)
|
|
{
|
|
if (!str)
|
|
return string("");
|
|
return string(str);
|
|
}
|
|
}
|
|
}
|
|
|
|
|