exposing function

This commit is contained in:
iceman1001 2020-06-07 19:47:36 +02:00
parent a9d89c7d06
commit 307e39bb22
2 changed files with 3 additions and 4 deletions

View file

@ -225,7 +225,7 @@ static char *filenamemcopy(const char *preferredName, const char *suffix) {
return fileName;
}
static char *newfilenamemcopy(const char *preferredName, const char *suffix) {
char *newfilenamemcopy(const char *preferredName, const char *suffix) {
if (preferredName == NULL) return NULL;
if (suffix == NULL) return NULL;
uint16_t preferredNameLen = strlen(preferredName);
@ -948,12 +948,10 @@ int loadFileJSONex(const char *preferredName, void *data, size_t maxdatalen, siz
if (fileName == NULL) return PM3_EMALLOC;
*datalen = 0;
json_t *root;
json_error_t error;
int retval = PM3_SUCCESS;
root = json_load_file(fileName, 0, &error);
json_t *root = json_load_file(fileName, 0, &error);
if (!root) {
PrintAndLogEx(ERR, "ERROR: json " _YELLOW_("%s") " error on line %d: %s", fileName, error.line, error.text);
retval = PM3_ESOFT;

View file

@ -77,6 +77,7 @@ int fileExists(const char *filename);
//bool create_path(const char *dirname);
//bool setDefaultPath (savePaths_t pathIndex,const char *Path); // set a path in the path list session.defaultPaths
char *newfilenamemcopy(const char *preferredName, const char *suffix);
/**
* @brief Utility function to save data to a binary file. This method takes a preferred name, but if that