From bcbf8ee526fe62e38d5ed79304c3004e08613c41 Mon Sep 17 00:00:00 2001 From: Rishitha Minol Date: Wed, 14 Mar 2018 13:38:31 +0530 Subject: [PATCH] customer requirement --- httpd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/httpd.c b/httpd.c index 4d12446..2738e7a 100644 --- a/httpd.c +++ b/httpd.c @@ -317,11 +317,13 @@ void send_json_response(int sockfd, struct myhttp_header *header, sqlite3 *db) write(sockfd, "{\"error\": \"error occured\"}\n", strlen("{\"error\": \"error occured\"}\n")); return; } + + int i = 1; while (t != NULL) { if (full_rank > 0) - sprintf(tempstr, "#%d:%s\n", t->col1_rank, t->coin_id); + sprintf(tempstr, "#%d-%s\n", t->col1_rank, t->coin_id); else - sprintf(tempstr, "#%s: %d (%d)\n", t->coin_id, t->col1_rank, t->col2_rank); + sprintf(tempstr, "#%d-%s: %d (%d)\n", i++, t->coin_id, t->col1_rank, t->col2_rank); write(sockfd, tempstr, strlen(tempstr)); t = t->next; }