/* */
getFileLine( FILE* fp, char buffer[128], int buffermax )
{ int i=0;
char c;
if( fp==NULL )
{ printf("\nfopen error\n");
exit(1);
}else{
do{
c=fgetc(fp);
buffer[i]=c;
i=i+1;
printf("%c",c);
}while(
c!= '\n' && c!=EOF && (i< buffermax ) );
}
/* replace the newline with a string terminator */
if( i>1 && buffer[i-1] == '\n' )
{ buffer[i-1] = '\0'; }
}/* end function */