#include "storage_sql.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#define strcasecmp _stricmp
#include <cstring>
#include <cstdlib>
#include <string>
#include <sstream>
#include <algorithm>
#include "compat/snprintf.h"
#include "common/eventlog.h"
#include "common/util.h"
static const char * sql_backslash_to_underscore(const char * key)
{
if (!key) {
ERROR0("got NULL key");
return NULL;
}
std::string rep = key;
std::replace(rep.begin(), rep.end(), '\\', '_');
return rep.c_str();
}
The above code returns NULL when I pass it strings like "acct\\username", "acct\\passhash" etc. What gives?