From 1dfed160718c91ab841a82c235694af32a88a4c5 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Sun, 29 Jul 2018 22:16:41 +0100 Subject: [PATCH] Remove C99 only code. --- src/ubus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ubus.c b/src/ubus.c index e216935..703a60d 100644 --- a/src/ubus.c +++ b/src/ubus.c @@ -20,7 +20,7 @@ #include -static struct ubus_context *ubus; +static struct ubus_context *ubus = NULL; static struct blob_buf b; static int ubus_handle_metrics(struct ubus_context *ctx, struct ubus_object *obj, @@ -74,9 +74,10 @@ static int ubus_handle_metrics(struct ubus_context *ctx, struct ubus_object *obj struct ubus_request_data *req, const char *method, struct blob_attr *msg) { + int i; blob_buf_init(&b, 0); - for(int i=0; i < __METRIC_MAX; i++) + for(i=0; i < __METRIC_MAX; i++) blobmsg_add_u32(&b, get_metric_name(i), daemon->metrics[i]); ubus_send_reply(ctx, req, b.head);