Skip to content

Commit

Permalink
Merge pull request #9 from Rubear/master
Browse files Browse the repository at this point in the history
Don't you just love it when moving 3 lines of code somewhere else makes it work?
  • Loading branch information
Cotix committed Jul 14, 2013
2 parents cab5e00 + 173a924 commit 3865ea9
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 3865ea9

Please sign in to comment.