#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char **argv){
	FILE *fp;
	int counter1 = 0;
	int counter2 = 0;
	char linestring[600000];
	char copystr[600000];

        if( ( fp = fopen( "texture2.xbm", "r" ) ) == NULL ) {
                fprintf( stderr, "Error opening texture2.xbm\n" );
                exit( 1 );
        }
        while( fgets(linestring, sizeof(linestring), fp) != NULL)
        {
			
			memset ((void*) copystr, '\0', sizeof (copystr));
                        strcpy(copystr, linestring);
			counter1++;
		if(counter1 < 10) {
			printf("strlen: %u counter1: %d\n", (unsigned int)strlen(linestring), counter1);
			//for(counter2 = 0; counter2 < strlen(copystr); counter2++) {
			//	printf("char%d: %d\n", counter2, copystr[counter2]);
				//counter2++;
			//}
		}
		//printf("counter1: %d\n", counter1);
		//memset ((void*) linestring, '\0', sizeof (linestring));	
	}
	fclose(fp);
	printf("counter1: %d\n", counter1);

return 0;

}
