Skip to content

Commit

Permalink
Fixed comments not working
Browse files Browse the repository at this point in the history
  • Loading branch information
rslabbert committed Jul 14, 2013
1 parent 408579f commit 173a924
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions reddit.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void redditGetThread(char * postid, struct comments * commentList, int * comment
jsmn_init(&p);
r = jsmn_parse(&p, js, t, 2500);
int i =0;
char buffer[6048];
char buffer[2048];

int atPost = 0;
for(i = 0; i < 2500; ++i)
Expand Down Expand Up @@ -220,10 +220,7 @@ void redditGetThread(char * postid, struct comments * commentList, int * comment
commentList[atPost].author = malloc(t[i].end-t[i].start+1);
tmp[t[i].end-t[i].start] = 0;
strcpy(commentList[atPost].author,tmp);
atPost++;
free(tmp);
if(atPost == 25)
break;
}
if(strcmp("body",buffer) == 0)
{
Expand All @@ -233,7 +230,10 @@ void redditGetThread(char * postid, struct comments * commentList, int * comment
tmp[t[i].end-t[i].start] = 0;
commentList[atPost].text = malloc(t[i].end-t[i].start+1);
strcpy(commentList[atPost].text,tmp);
atPost++;
free(tmp);
if(atPost == 25)
break;
}
}
*commentCount = atPost;
Expand Down

0 comments on commit 173a924

Please sign in to comment.