summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-09 11:17:49 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-09 11:17:49 +0200
commit5badf2b6bf0e4717ac940966292127e01f659804 (patch)
tree2ab62ed994154f6968350d55cdcc5b3c28c6076c
parent1e2f3e437492ecc841bc9852ab46ce0e218e4723 (diff)
Clarify define
-rw-r--r--idle.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/idle.c b/idle.c
index 89a8f9a..518999b 100644
--- a/idle.c
+++ b/idle.c
@@ -115,7 +115,7 @@ write_cmd(char **pos, const char *begin, const char *end)
write_bytes(pos, begin, end - begin);
}
-#define JSON_NEEDLE "\"online\""
+#define ONLINE_NEEDLE "\"online\""
static void
idle_check_handshake_reply(struct cfg *cfg, struct uring_task *task, int res)
{
@@ -198,7 +198,7 @@ idle_check_handshake_reply(struct cfg *cfg, struct uring_task *task, int res)
char *end;
unsigned count;
- online = memmem(pos, remain, JSON_NEEDLE, strlen(JSON_NEEDLE));
+ online = memmem(pos, remain, ONLINE_NEEDLE, strlen(ONLINE_NEEDLE));
if (!online) {
fprintf(stderr, "Could not find online count in JSON\n");
goto error;
@@ -213,7 +213,7 @@ idle_check_handshake_reply(struct cfg *cfg, struct uring_task *task, int res)
}
*end = '\0';
- if (sscanf(online, JSON_NEEDLE " : %u", &count) != 1) {
+ if (sscanf(online, ONLINE_NEEDLE " : %u", &count) != 1) {
fprintf(stderr, "Could not parse JSON (online count)\n");
goto error;
}