commit 25578d94289f553d80009150b11a91895840d9ff
parent 97bd389935b6a17768dfdba9945850b5ee6a133c
Author: Joris Vink <joris@coders.se>
Date: Wed, 6 May 2015 10:18:25 +0200
Pass the proper size to http_state_run().
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/examples/pgsql/src/pgsql.c b/examples/pgsql/src/pgsql.c
@@ -59,6 +59,8 @@ struct http_state mystates[] = {
{ "REQ_STATE_DONE", request_done },
};
+#define mystates_size (sizeof(mystates) / sizeof(mystates[0]))
+
struct rstate {
struct kore_pgsql sql;
};
@@ -77,7 +79,7 @@ page(struct http_request *req)
{
/* Drop into our state machine. */
kore_log(LOG_NOTICE, "page start");
- return (http_state_run(mystates, sizeof(mystates), req));
+ return (http_state_run(mystates, mystates_size, req));
}
/* The initial state, we setup our context and fire off the pgsql query. */