Merge pull request #1104 from mmichal10/init-var

Initialize uninitialized variable
This commit is contained in:
Robert Baldyga 2022-03-21 08:34:06 +01:00 committed by GitHub
commit 30eff21e65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 10 deletions

View File

@ -26,9 +26,9 @@ Open CAS uses Safe string library (safeclib) that is MIT licensed.
To download latest Open CAS Linux release run following commands:
```
wget https://github.com/Open-CAS/open-cas-linux/releases/download/v21.6.1/open-cas-linux-21.06.1.0547.release.tar.gz
tar -xf open-cas-linux-21.06.1.0547.release.tar.gz
cd open-cas-linux-21.06.1.0547.release/
wget https://github.com/Open-CAS/open-cas-linux/releases/download/v21.6.5/open-cas-linux-21.06.5.0555.release.tar.gz
tar -xf open-cas-linux-21.06.5.0555.release.tar.gz
cd open-cas-linux-21.06.5.0555.release/
```
Alternatively, if you want recent development (unstable) version, you can clone GitHub repository:

View File

@ -2751,7 +2751,7 @@ int list_caches(unsigned int list_format, bool by_id_path)
char status_buf[CACHE_STATE_LENGHT];
const char *tmp_status;
char mode_string[12];
char cache_ctrl_dev[MAX_STR_LEN];
char cache_ctrl_dev[MAX_STR_LEN] = "-";
float cache_flush_prog;
float core_flush_prog;
@ -2778,13 +2778,10 @@ int list_caches(unsigned int list_format, bool by_id_path)
if (!curr_cache->standby_detached) {
snprintf(cache_ctrl_dev, sizeof(cache_ctrl_dev),
"/dev/cas-cache-%d", curr_cache->id);
} else {
strncpy(cache_ctrl_dev, "-", sizeof(cache_ctrl_dev));
}
} else {
snprintf(mode_string, sizeof(mode_string), "%s",
cache_mode_to_name(curr_cache->mode));
strncpy(cache_ctrl_dev, "-", sizeof(cache_ctrl_dev));
}
}