I'm trying to get my code to go through every file in a directory and check to see if it contains an ID3 tag or not. If it has no ID3 tag it's supposed to say so. My problem is that on most directories it just makes it through 2 files and stops. Or if I point it at a directory that only contains other directories then it says no ID3 tag found twice and stops. But if I point it to my /home/bl0w directory it lists it for every single file. I can't seem to figure out why when I point it to a directory with no mp3s it works, but when I point it to a directory with mp3s, it makes it look like there is only 2 files which aren't mp3. Any help would be greatly appreciated.

Code:
	//Open Directory For Reading
	DIR* dir = opendir(argv[1]);
	if (!dir) {perror("opendir");}
	struct dirent* entry;

	//For Each File In Directory...
	while ((entry = readdir(dir)) != NULL) 
	{
		char buffer[256];
		//Open File For Reading
		if((file = fopen(entry->d_name, "r"))==NULL) return(1);

		//Move To Last 128 bytes
		fseek(file,-128L,SEEK_END);

		//Read To Buffer and Close File

		fread(buffer,1,128,file);

  		fclose(file);

		//Look For 'TAG', Indicating ID3 Tag

		if (strncmp(buffer,"TAG",3)==0)

    		{

			char *b=buffer+3,*c=b+29;

    			//Read out title & artist

			while(c>b && *c==' ') c--;

			*++c=0;

			//Save Title

			strcpy(song,b);

			b=buffer+33; c=b+29;

			while(c>b && *c==' ') c--;

			*++c=0;

			//Save Artist

			strcpy(artist,b);

			//Save Year

			if ((year=atoi(buffer+93))==0) year=9999;
			printf(song);
			
			

		}

		else

		{

			printf("File Not MP3 or No ID3 Tag exists.\n");
		}
		}

	
	//Close Directory
	if (closedir(dir) == -1) {
    		perror("closedir");
	}