Skip to content

Commit

Permalink
Fixed ID reading
Browse files Browse the repository at this point in the history
  • Loading branch information
tivervac committed Feb 17, 2013
1 parent e0b5938 commit e7a014e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@

int main(){
{
char *listID = (char*) malloc(MAX_ID_LENGTH * sizeof(char));
char *listID = (char*) malloc((MAX_ID_LENGTH + 1) * sizeof(char));
char *url = (char *) malloc(strlen(PREFIX) + 1 * sizeof(char));
strcpy(url, PREFIX);
url = (char*) realloc(url, strlen(PREFIX) + 1 + 1 * sizeof(char));
printf("%s", "Enter the listID: ");
scanf("%s", listID);
//url = (char*) realloc(url, strlen(PREFIX) + 1 + 1 * sizeof(char));
printf("%s", "Enter the listID (64 chars max): ");
scanf("%64s", listID);
url = construct_url(url, listID);
send_playlist_request(url);

free(url);
url = NULL;
free(listID);
listID = NULL;
printf("All downloads completed!\n");
}
_CrtDumpMemoryLeaks();
Expand Down
2 changes: 1 addition & 1 deletion main.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#define PREFIX "http://gdata.youtube.com/feeds/api/playlists/"
#define SUFFIX "?v=2"
#define MAX_ID_LENGTH 32
#define MAX_ID_LENGTH 64
#define PROGRAM "youtube-dl.exe"

int main();
Expand Down

0 comments on commit e7a014e

Please sign in to comment.