mirror of
https://github.com/ipmitool/ipmitool.git
synced 2026-06-28 16:21:35 +00:00
Refactoring: optimize pointer checks
Remove all direct comparisons to 'NULL' for pointers. Replace them with boolean-like 'if (ptr)' and 'if (!ptr)'. This makes conditions shorter and easier to read. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
This commit is contained in:
@@ -108,12 +108,12 @@ void log_init(const char * name, int isdaemon, int verbose)
|
||||
if (!logpriv)
|
||||
return;
|
||||
|
||||
if (name != NULL)
|
||||
if (name)
|
||||
logpriv->name = strdup(name);
|
||||
else
|
||||
logpriv->name = strdup(LOG_NAME_DEFAULT);
|
||||
|
||||
if (logpriv->name == NULL)
|
||||
if (!logpriv->name)
|
||||
fprintf(stderr, "ipmitool: malloc failure\n");
|
||||
|
||||
logpriv->daemon = isdaemon;
|
||||
|
||||
Reference in New Issue
Block a user