Skip to content

Commit 2fc8907

Browse files
committed
refactor: introduce storage fcp max length define
1 parent 226b9ec commit 2fc8907

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

include/onomondo/softsim/storage.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ set higher than necessary. */
3030
#define PATH_SEPARATOR "/"
3131
#endif
3232

33+
#ifdef CONFIG_COMPACT_STORAGE
34+
#define FCP_MAX_LEN 200
35+
#else
36+
#define FCP_MAX_LEN 1024
37+
#endif
38+
3339
extern char storage_path[SS_STORAGE_PATH_MAX];
3440

3541
/*! Set the SoftSIM filesystem storage path.

src/softsim/storage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static int gen_abs_host_path(char *def_path, const struct ss_list *path, bool de
8686
static int read_file_def(char *host_path, struct ss_file *file)
8787
{
8888
ss_FILE fd;
89-
char line_buf[1024];
89+
char line_buf[FCP_MAX_LEN];
9090
size_t rc;
9191

9292
fd = ss_fopen(host_path, "r");

src/softsim/storage_compact.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static int gen_abs_host_path(char *def_path, const struct ss_list *path, bool de
8585
static int read_file_def(char *host_path, struct ss_file *file)
8686
{
8787
ss_FILE fd;
88-
char line_buf[200]; /* maximum fcp length */
88+
char line_buf[FCP_MAX_LEN];
8989
char *rc;
9090

9191
fd = ss_fopen(host_path, "r");

0 commit comments

Comments
 (0)