How to retain linefeed, and carriage return characters (10 and 13) ?

Hi.
I�ve just unpacked my first RCM4010 Development Kit and tried to send the text stream from HyperTerminal on my PC to Serial Port D. After making all necessary connections, I opened a small text file and copy, then on HyperTerminal I select paste to host to Rabbit, this what I did on rabbit core,

#define DINBUFSIZE 15
#define DOUTBUFSIZE 15
#define maxs 30000
#define timeout 3000UL
void main()
{
int getOk, d, g, done;
char s[maxs + 1]; // plus 1 for null terminator
char cOut1[1000];
done = 0;
d=0;
serDopen(19200);
while (!done) {
loophead();
costate {
wfd getOk = cof_serDgets(s, maxs, timeout); terminated string

    		if (getOk) {
  			wfd cof_serDputs(s);                     
        		strncat(cOut1,s,10000);
  		}
  		else {
  			if (!strcmp(s, "q")) {
        			wfd cof_serDputs("Done");
  				done = 1;
         	}
  			else
  				wfd cof_serDputs("Timed out!");
           			d=strlen(cOut1);
          			 	for (g=1;g<=d;++g)
    					{
              				printf ("%d

",cOut1[g-1]);
}
}
}
}
while (serDwrFree() != DOUTBUFSIZE) ;
serDclose();
}

My problems are-

  1. The original text file contains some linefeed, and carriage return characters (10 and 13) but when I received them on rabbit, they are filtered out)…How do I retain them?
  2. Some parts of text file are missing, it seems that cOut1 could not collect all the received information from s, cof_serDgets(s, maxs, timeout). Does strncat function interrupt the text receiving stream on serDgets? How do I fix this?

Could anybody help me please?

Thank You…
:confused: