Commit d6cbf9f7 authored by NickCis's avatar NickCis

Fixing C coding style mistakes

parent c06abbc5
// Copyright (c) 2014 Cesanta Software
// All rights reserved
//
// This example demostrates basic use of Mongoose embedded web server.
// This example demostrates how to use array get variables using mg_get_n_var
// $Date: 2014-09-09 22:20:23 UTC $
#include <stdio.h>
......@@ -15,8 +15,7 @@ static int ev_handler(struct mg_connection *conn, enum mg_event ev) {
{
mg_printf_data(conn, "Hello! Requested URI is [%s] ", conn->uri);
char buffer[1024];
int ret,
i;
int i, ret;
for(i=0; (ret = mg_get_n_var(conn, "foo[]", buffer, 1024, i)) > 0; i++)
mg_printf_data(conn, "\nfoo[%d] = %s", i, buffer);
......
......@@ -5001,7 +5001,7 @@ static int get_var(const char *data, size_t data_len, const char *name,
char *dst, size_t dst_len, int n) {
const char *p, *e, *s;
size_t name_len;
int len;
int i, len;
if (dst == NULL || dst_len == 0) {
len = -2;
......@@ -5009,12 +5009,12 @@ static int get_var(const char *data, size_t data_len, const char *name,
len = -1;
dst[0] = '\0';
} else {
i = 0;
name_len = strlen(name);
e = data + data_len;
len = -1;
dst[0] = '\0';
int i = 0;
// data is "var1=val1&var2=val2...". Find variable first
for (p = data; p + name_len < e; p++) {
if ((p == data || p[-1] == '&') && p[name_len] == '=' &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment