~sircmpwn/hare-dev

harec: fix x{re,c}alloc behavior with size=0 v1 APPLIED

Bor Grošelj Simić: 1
 fix x{re,c}alloc behavior with size=0

 1 files changed, 2 insertions(+), 2 deletions(-)
#787338 alpine.yml success
#787339 freebsd.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/hare-dev/patches/33266/mbox | git am -3
Learn more about email & git

[PATCH harec] fix x{re,c}alloc behavior with size=0 Export this patch

Calloc and realloc may return NULL during normal operation if
the requested size is 0.

Signed-off-by: Bor Grošelj Simić <bgs@turminal.net>
---
 src/util.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util.c b/src/util.c
index 6fb5f82..2407660 100644
--- a/src/util.c
+++ b/src/util.c
@@ -63,7 +63,7 @@ void *
xcalloc(size_t n, size_t s)
{
	void *p = calloc(n, s);
	if (!p) {
	if (!p && s) {
		abort();
	}
	return p;
@@ -73,7 +73,7 @@ void *
xrealloc(void *p, size_t s)
{
	p = realloc(p, s);
	if (!p) {
	if (!p && s) {
		abort();
	}
	return p;
-- 
2.36.1
harec/patches: SUCCESS in 47s

[fix x{re,c}alloc behavior with size=0][0] from [Bor Grošelj Simić][1]

[0]: https://lists.sr.ht/~sircmpwn/hare-dev/patches/33266
[1]: mailto:bgs@turminal.net

✓ #787338 SUCCESS harec/patches/alpine.yml  https://builds.sr.ht/~sircmpwn/job/787338
✓ #787339 SUCCESS harec/patches/freebsd.yml https://builds.sr.ht/~sircmpwn/job/787339
Thanks!

To git@git.sr.ht:~sircmpwn/harec
   df1dac2..62d4204  master -> master