From eb5ca56e76013ac281129659efa2169ac125188e Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Fri, 14 Apr 2023 19:11:38 +0200 Subject: use errno ENOMEM instead of EOVERFLOW This matches the behaviour of setting errno for malloc/calloc on the following systems too: glibc, musl libc, OpenBSD libc. It is also more portable for (older) systems. --- sfeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfeed.c b/sfeed.c index e2f44b8..af4534c 100644 --- a/sfeed.c +++ b/sfeed.c @@ -293,7 +293,7 @@ string_append(String *s, const char *data, size_t len) return; if (s->len >= SIZE_MAX - len) { - errno = EOVERFLOW; + errno = ENOMEM; err(1, "realloc"); } -- cgit v1.2.3