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


/* Sloppy hack, ain't it? */

int main( int argc, char *argv[] ) {

	char buffer[1000][2000];
	int i, j;
	FILE *f;

	f = fopen( argv[1], "r" );
	if( !f ) exit(0);

	i = 0;
	fgets( buffer[i], 2000, f );
	while( !feof(f) ) {
		if( strlen(buffer[i]) > 1995 ) exit(0);
		buffer[i][strlen(buffer[i])-1] = '\0';  /* kill the newline */
		strcat( buffer[i], "<br>\n" );
		i++;
		fgets( buffer[i], 2000, f );
	}
	fclose( f );
	f = fopen( argv[1], "w" );
	if( !f ) exit(0);
	for( j = 0; j < i; j++ )
		fprintf( f, buffer[j] );
	fclose( f );

	return 0;
}
