X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/149aeadaa609b01db86ba3b4ee23b317f16bede5..a501c82b196b614295a6e3bf7481da84affb0d8e:/client/util.c?ds=inline diff --git a/client/util.c b/client/util.c index 903791a0..56c4998d 100644 --- a/client/util.c +++ b/client/util.c @@ -46,12 +46,18 @@ int ukbhit(void) { #endif // log files functions -void AddLogLine(char *fileName, char *extData, char *c) { +void AddLogLine(char *file, char *extData, char *c) { FILE *fLog = NULL; - - fLog = fopen(fileName, "a"); + char filename[FILE_PATH_SIZE] = {0x00}; + int len = 0; + + len = strlen(file); + if (len > FILE_PATH_SIZE) len = FILE_PATH_SIZE; + memcpy(filename, file, len); + + fLog = fopen(filename, "a"); if (!fLog) { - printf("Could not append log file %s", fileName); + printf("Could not append log file %s", filename); return; }