summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--snac.h2
-rw-r--r--webfinger.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/snac.h b/snac.h
index 7cce8f2..d2cb9c3 100644
--- a/snac.h
+++ b/snac.h
@@ -8,6 +8,8 @@ extern int srv_running;
8 8
9extern int dbglevel; 9extern int dbglevel;
10 10
11#define valid_status(status) ((status) >= 200 && (status) <= 299)
12
11d_char *xs_time(char *fmt, int local); 13d_char *xs_time(char *fmt, int local);
12#define xs_local_time(fmt) xs_time(fmt, 1) 14#define xs_local_time(fmt) xs_time(fmt, 1)
13#define xs_utc_time(fmt) xs_time(fmt, 0) 15#define xs_utc_time(fmt) xs_time(fmt, 0)
diff --git a/webfinger.c b/webfinger.c
index 2364b70..519fb67 100644
--- a/webfinger.c
+++ b/webfinger.c
@@ -68,7 +68,7 @@ void webfinger_request(char *qs, int *status, char **actor, char **user)
68 xs_http_request("GET", url, headers, NULL, 0, status, &payload, &p_size); 68 xs_http_request("GET", url, headers, NULL, 0, status, &payload, &p_size);
69 } 69 }
70 70
71 if (*status >= 200 && *status <= 299) { 71 if (valid_status(*status)) {
72 xs *obj = xs_json_loads(payload); 72 xs *obj = xs_json_loads(payload);
73 73
74 if (user != NULL) { 74 if (user != NULL) {