From 581043bc900b6082fd86bce1a5d9beaa69de0fad Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Tue, 5 Mar 2019 20:33:18 +0100 Subject: [PATCH] Look for aidlist.json in the client dir --- client/cmdsmartcard.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/cmdsmartcard.c b/client/cmdsmartcard.c index 8b10dc6fe..f371c87ce 100644 --- a/client/cmdsmartcard.c +++ b/client/cmdsmartcard.c @@ -87,10 +87,9 @@ static int smart_loadjson(const char *preferredName, const char *suffix, json_t if ( suffix == NULL ) return 1; int retval = 0; - int size = sizeof(char) * (strlen(preferredName) + strlen(suffix) + 10); + int size = sizeof(char) * (strlen(get_my_executable_directory()) + strlen(preferredName) + strlen(suffix) + 10); char * fileName = calloc(size, sizeof(char)); - sprintf(fileName, "%s.%s", preferredName, suffix); - + sprintf(fileName, "%s%s.%s", get_my_executable_directory(), preferredName, suffix); *root = json_load_file(fileName, 0, &error); if (!*root) { PrintAndLogEx(ERR, "json (%s) error on line %d: %s", fileName, error.line, error.text);