Skip to content

Commit 01c427f

Browse files
committed
Replaced initializer list with in-class initializer in AuditLog
1 parent 31fb939 commit 01c427f

File tree

2 files changed

+14
-27
lines changed

2 files changed

+14
-27
lines changed

headers/modsecurity/audit_log.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -183,32 +183,32 @@ class AuditLog {
183183

184184
bool merge(AuditLog *from, std::string *error);
185185

186-
std::string m_path1;
187-
std::string m_path2;
188-
std::string m_storage_dir;
189-
std::string m_header;
186+
std::string m_path1 = std::string("");
187+
std::string m_path2 = std::string("");
188+
std::string m_storage_dir = std::string("");
189+
std::string m_header = std::string("");
190190

191-
AuditLogFormat m_format;
191+
AuditLogFormat m_format = NotSetAuditLogFormat;
192192

193193
protected:
194-
int m_parts;
194+
int m_parts = -1;
195195
int m_defaultParts = AAuditLogPart | BAuditLogPart | CAuditLogPart
196196
| FAuditLogPart | HAuditLogPart | ZAuditLogPart;
197197

198-
int m_filePermission;
198+
int m_filePermission = -1;
199199
int m_defaultFilePermission = 0640;
200200

201-
int m_directoryPermission;
201+
int m_directoryPermission = -1;
202202
int m_defaultDirectoryPermission = 0750;
203203

204204
private:
205-
AuditLogStatus m_status;
205+
AuditLogStatus m_status = NotSetLogStatus;
206206

207-
AuditLogType m_type;
208-
std::string m_relevant;
207+
AuditLogType m_type = NotSetAuditLogType;
208+
std::string m_relevant = std::string("");
209209

210-
audit_log::writer::Writer *m_writer;
211-
bool m_ctlAuditEngineActive; // rules have at least one action On or RelevantOnly
210+
audit_log::writer::Writer *m_writer = NULL;
211+
bool m_ctlAuditEngineActive = false; // rules have at least one action On or RelevantOnly
212212
};
213213

214214

src/audit_log/audit_log.cc

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,7 @@ namespace modsecurity {
5151
namespace audit_log {
5252

5353

54-
AuditLog::AuditLog()
55-
: m_path1(""),
56-
m_path2(""),
57-
m_storage_dir(""),
58-
m_header(""),
59-
m_format(NotSetAuditLogFormat),
60-
m_parts(-1),
61-
m_filePermission(-1),
62-
m_directoryPermission(-1),
63-
m_status(NotSetLogStatus),
64-
m_type(NotSetAuditLogType),
65-
m_relevant(""),
66-
m_writer(NULL),
67-
m_ctlAuditEngineActive(false) { }
54+
AuditLog::AuditLog() { }
6855

6956

7057
AuditLog::~AuditLog() {

0 commit comments

Comments
 (0)