SMOLNET PORTAL home about changes
use errno ENOMEM instead of EOVERFLOW - sfeed - RSS and Atom parser
(URL) git clone git://git.codemadness.org/sfeed (git://git.codemadness.org)
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit eb5ca56e76013ac281129659efa2169ac125188e
(DIR) parent ebd7175e56141e8e8816b1b27f1abc773818b6aa
(URL) Author: Hiltjo Posthuma <hiltjo@codemadness.org> (mailto://) application/vnd.lotus-organizer
Date: Fri, 14 Apr 2023 19:11:38 +0200
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.
Diffstat:
M sfeed.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
(DIR) diff --git 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");
}
Response: application/gopher-menu
Original URLgopher://codemadness.org/1/git/sfeed/commit/eb5ca56e76013...
Content-Typeapplication/gopher-menu; charset=utf-8