general code cleanup

This commit is contained in:
Antonio SJ Musumeci 2019-01-25 07:03:46 -05:00
parent 5a1a60742e
commit 9d9ee7b71d
178 changed files with 5100 additions and 5255 deletions

View file

@ -18,29 +18,29 @@
#pragma once
#include <string>
#include <stdlib.h>
#include <string.h>
#include <string>
namespace fs
{
static
inline
int
mkstemp(std::string &filepath)
mkstemp(std::string &filepath_)
{
int fd;
char buf[filepath.size()+8];
char buf[filepath_.size()+8];
strcpy(buf,filepath.c_str());
strcpy(buf+filepath.size(),".XXXXXX");
strcpy(buf,filepath_.c_str());
strcpy(buf+filepath_.size(),".XXXXXX");
fd = ::mkstemp(buf);
if(fd == -1)
return -1;
filepath = buf;
filepath_ = buf;
return fd;
}