Skip to content

Commit

Permalink
Fix #112
Browse files Browse the repository at this point in the history
  • Loading branch information
simon987 committed Sep 23, 2020
1 parent d3bd53a commit ae283f7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/web/serve.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,8 @@ void tag(struct mg_connection *nc, struct http_message *hm, struct mg_str *path)
}
}

char buf[8192];
snprintf(buf, sizeof(buf),
char *buf = malloc(sizeof(char) * 8192);
snprintf(buf, 8192,
"{"
" \"script\" : {"
" \"source\": \"if (ctx._source.tag.contains(params.tag)) { ctx._source.tag.remove(ctx._source.tag.indexOf(params.tag)) }\","
Expand All @@ -555,8 +555,8 @@ void tag(struct mg_connection *nc, struct http_message *hm, struct mg_str *path)
} else {
cJSON_AddItemToArray(arr, cJSON_CreateString(arg_req->name));

char buf[8192];
snprintf(buf, sizeof(buf),
char *buf = malloc(sizeof(char) * 8192);
snprintf(buf, 8192,
"{"
" \"script\" : {"
" \"source\": \"if(ctx._source.tag == null) {ctx._source.tag = new ArrayList()} ctx._source.tag.add(params.tag)\","
Expand Down

0 comments on commit ae283f7

Please sign in to comment.