Skip to content

Commit

Permalink
customer requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
rishithaminol committed Mar 14, 2018
1 parent c7278ff commit bcbf8ee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions httpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit bcbf8ee

Please sign in to comment.