snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 28c7961e67e67293c3cdc443e757693e1335d1ec
parent d66b20a8808a1b51931b8193ce54c5f6c054b338
Author: default <nobody@localhost>
Date:   Thu, 22 Sep 2022 11:50:53 +0200

New macro valid_status().

Diffstat:
Msnac.h | 2++
Mwebfinger.c | 2+-
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/snac.h b/snac.h @@ -8,6 +8,8 @@ extern int srv_running; extern int dbglevel; +#define valid_status(status) ((status) >= 200 && (status) <= 299) + d_char *xs_time(char *fmt, int local); #define xs_local_time(fmt) xs_time(fmt, 1) #define xs_utc_time(fmt) xs_time(fmt, 0) diff --git a/webfinger.c b/webfinger.c @@ -68,7 +68,7 @@ void webfinger_request(char *qs, int *status, char **actor, char **user) xs_http_request("GET", url, headers, NULL, 0, status, &payload, &p_size); } - if (*status >= 200 && *status <= 299) { + if (valid_status(*status)) { xs *obj = xs_json_loads(payload); if (user != NULL) {