Skip to content

Commit

Permalink
fix to small filename limit (#669)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Parfenov <a1994ndrey@gmail.com>
  • Loading branch information
Andrey1994 committed Aug 18, 2023
1 parent 94d9243 commit 8552bbe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/board_controller/file_streamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
FileStreamer::FileStreamer (const char *file, const char *file_mode, int data_len)
: Streamer (data_len, "file", file, file_mode)
{
strcpy (this->file, file);
strcpy (this->file_mode, file_mode);
strncpy (this->file, file, BRAINFLOW_FILE_NAME_LIMIT);
strncpy (this->file_mode, file_mode, BRAINFLOW_FILE_NAME_LIMIT);
fp = NULL;
}

Expand Down
5 changes: 3 additions & 2 deletions src/board_controller/inc/file_streamer.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "streamer.h"

#define BRAINFLOW_FILE_NAME_LIMIT 512

class FileStreamer : public Streamer
{
Expand All @@ -16,7 +17,7 @@ class FileStreamer : public Streamer
void stream_data (double *data);

private:
char file[128];
char file_mode[128];
char file[BRAINFLOW_FILE_NAME_LIMIT];
char file_mode[BRAINFLOW_FILE_NAME_LIMIT];
FILE *fp;
};

0 comments on commit 8552bbe

Please sign in to comment.