Avoid fwrite failure while trying to write empty missing helpers string
This commit is contained in:
parent
2c2c0dadf2
commit
cd27645cc2
@ -590,7 +590,7 @@ void RclConfig::storeMissingHelperDesc(const string &s)
|
||||
string fmiss = path_cat(getConfDir(), "missing");
|
||||
FILE *fp = fopen(fmiss.c_str(), "w");
|
||||
if (fp) {
|
||||
if (fwrite(s.c_str(), s.size(), 1, fp) != 1) {
|
||||
if (s.size() > 0 && fwrite(s.c_str(), s.size(), 1, fp) != 1) {
|
||||
LOGERR(("storeMissingHelperDesc: fwrite failed\n"));
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user