pgrm
11/22/2012 - 11:25 AM

AMPP - crappy loop

AMPP - crappy loop

do {
		ch = fgetc(in1);
		if ( ch == EOF ) break;
		LOOP1: if ( ch == 10 || ch == 13 ) {
			// newline or carriage return
			ch = fgetc(in1);
			if ( ch == EOF ) break;
			goto LOOP1;
			}
		// Bad style with 'goto', but then 
		// one need not assume there aren't 2 '\n' in a row  

		while ( isdigit(ch)|| ch==' ' ) ch=fgetc(in1); 
		// skip over position number and blanks

		a[++i]= char2AA(ch);	// preincrement and cast
		if (i+1==N) break;	// don't overflow array size

	} while ( 1 );		/** infinite while loop */