summaryrefslogtreecommitdiffstats
path: root/xmalloc.c
diff options
context:
space:
mode:
authorpgen <p.gen.progs@gmail.com>2024-01-03 23:19:55 +0100
committerpgen <p.gen.progs@gmail.com>2024-01-03 23:19:55 +0100
commitb94264e55f4ac61c1d9d39382d96eff38f115a18 (patch)
tree13ad928ea80b8fdf5ce9316feba823d3786f38ea /xmalloc.c
parent31f6f07d8b3aa4bc9e950ebc5cfc52726b987ea1 (diff)
Normalize NULLity tests and fix a logical error
Diffstat (limited to 'xmalloc.c')
-rw-r--r--xmalloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xmalloc.c b/xmalloc.c
index df00249..4e7f35d 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -157,7 +157,7 @@ xstrndup(const char *str, size_t len)
p = memchr(str, '\0', len);
- if (p)
+ if (p != NULL)
len = p - str;
p = malloc(len + 1);