small fixes - frontends - front-ends for some sites (experiment) (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit 478a38c2ab8ebbeb700d2a677b2d525c1e4baaaf (DIR) parent b0a8d5b6a5b42748eb87a17b45cd81ab0e9edee2 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Fri, 14 Apr 2023 19:46:32 +0200 small fixes Diffstat: M json.c | 2 +- M reddit/cgi.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) --- (DIR) diff --git a/json.c b/json.c @@ -82,7 +82,7 @@ capacity(char **value, size_t *sz, size_t cur, size_t inc) /* check for addition overflow */ if (cur > SIZE_MAX - inc) { - errno = EOVERFLOW; + errno = ENOMEM; return -1; } need = cur + inc; (DIR) diff --git a/reddit/cgi.c b/reddit/cgi.c @@ -58,7 +58,7 @@ parsecgi(void) if ((p = getparam(query, "page"))) { if (decodeparam(page, sizeof(page), p) == -1) page[0] = '\0'; - /* check if it's a number > 0 and < 100 */ + /* check if it's a number >= 0 and < 100 */ errno = 0; curpage = strtol(page, NULL, 10); if (errno || curpage < 0 || curpage > 100) { @@ -72,7 +72,7 @@ parsecgi(void) if ((p = getparam(query, "limit"))) { if (decodeparam(slimit, sizeof(slimit), p) == -1) slimit[0] = '\0'; - /* check if it's a number >= 0 and < 100 */ + /* check if it's a number > 0 and < 100 */ errno = 0; limit = strtol(slimit, NULL, 10); if (errno || limit <= 0 || limit > 100) {