summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2023-04-14 19:11:38 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2023-04-14 19:11:38 +0200
commiteb5ca56e76013ac281129659efa2169ac125188e (patch)
tree5082cff5c64a66bb27c6f0751431c06c2dc17bb5
parentebd7175e56141e8e8816b1b27f1abc773818b6aa (diff)
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.
-rw-r--r--sfeed.c2
1 files changed, 1 insertions, 1 deletions
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");
}