implement own tmp function / satify compiler

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
TangoCash
2018-09-02 01:42:51 +02:00
committed by Thilo Graf
parent bbecf5c764
commit cf885b1027
4 changed files with 23 additions and 6 deletions

View File

@@ -1527,6 +1527,25 @@ bool utf8_check_is_valid(const std::string &str)
return true;
}
std::string genTmpName(std::string suffix,unsigned int length)
{
const char alphanum[] =
"0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
int stringLength = sizeof(alphanum) - 1;
std::string Str;
unsigned int i;
Str.append("/tmp/");
for( i = 0; i < length; ++i)
{
Str += alphanum[rand() % stringLength];
}
Str += ".";
Str += suffix;
return Str;
}
// curl
static void *myrealloc(void *ptr, size_t size)
{