diff options
author | 2016-04-24 12:57:58 +0200 | |
---|---|---|
committer | 2016-04-24 12:58:31 +0200 | |
commit | 89c5e1f681107b6d9f8ba7f761c388d1e2052fe4 (patch) | |
tree | c5ce4530d0c03fa1c04021844272b82b7b7ebcbc /src/lib/netlist/plib/pfmtlog.cpp | |
parent | ef0968b87042040e1f0e18c84ce804f744f8e23e (diff) |
Various cleanups suggested by static analyzer (nw)
Diffstat (limited to 'src/lib/netlist/plib/pfmtlog.cpp')
-rw-r--r-- | src/lib/netlist/plib/pfmtlog.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/netlist/plib/pfmtlog.cpp b/src/lib/netlist/plib/pfmtlog.cpp index d66b8f62520..25ed4c4d391 100644 --- a/src/lib/netlist/plib/pfmtlog.cpp +++ b/src/lib/netlist/plib/pfmtlog.cpp @@ -61,7 +61,7 @@ void pformat::format_element(const char *f, const char *l, const char *fmt_spec, m_arg++; int sl = sprintf(search, "%%%d", m_arg); char *p = strstr(m_str, search); - if (p != NULL) + if (p != nullptr) { // Make room memmove(p+nl, p+sl, strlen(p) + 1 - sl); @@ -80,23 +80,23 @@ void pfmt::format_element(const char *f, const char *l, const char *fmt_spec, . m_arg++; int sl = sprintf(search, "{%d:", m_arg); char *p = strstr(m_str, search); - if (p == NULL) + if (p == nullptr) { sl = sprintf(search, "{%d}", m_arg); p = strstr(m_str, search); - if (p == NULL) + if (p == nullptr) { sl = 2; p = strstr(m_str, "{}"); } - if (p==NULL) + if (p==nullptr) { sl=1; p = strstr(m_str, "{"); - if (p != NULL) + if (p != nullptr) { char *p1 = strstr(p, "}"); - if (p1 != NULL) + if (p1 != nullptr) { sl = p1 - p + 1; strncat(fmt, p+1, p1 - p - 2); @@ -111,7 +111,7 @@ void pfmt::format_element(const char *f, const char *l, const char *fmt_spec, . else { char *p1 = strstr(p, "}"); - if (p1 != NULL) + if (p1 != nullptr) { sl = p1 - p + 1; if (m_arg>=10) @@ -124,20 +124,20 @@ void pfmt::format_element(const char *f, const char *l, const char *fmt_spec, . } strcat(fmt, l); char *pend = fmt + strlen(fmt) - 1; - if (strchr("fge", *fmt_spec) != NULL) + if (strchr("fge", *fmt_spec) != nullptr) { - if (strchr("fge", *pend) == NULL) + if (strchr("fge", *pend) == nullptr) strcat(fmt, fmt_spec); } - else if (strchr("duxo", *fmt_spec) != NULL) + else if (strchr("duxo", *fmt_spec) != nullptr) { - if (strchr("duxo", *pend) == NULL) + if (strchr("duxo", *pend) == nullptr) strcat(fmt, fmt_spec); } else strcat(fmt, fmt_spec); int nl = vsprintf(buf, fmt, ap); - if (p != NULL) + if (p != nullptr) { // check room unsigned new_size = (p - m_str) + nl + strlen(p) + 1 - sl; |