mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 23:42:51 +02:00
implement own tmp function / satify compiler
Origin commit data
------------------
Commit: 841b6efd95
Author: TangoCash <eric@loxat.de>
Date: 2018-09-02 (Sun, 02 Sep 2018)
This commit is contained in:
@@ -1714,6 +1714,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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user