int limit;
char *buffer;
- limit=(soc->maxcarin-soc->carin)-1;
buffer=soc->carpile+soc->carin;
+ limit=(soc->maxcarin-soc->carin);
+ (void) memset(buffer,'\000',limit);
+ limit--;
switch (soc->modtls) {
case true :
got=tls_read(soc->tls,buffer,limit);
break;
}
if (got>0) { //we have recived some character
+ char *ptr;
+
+ //removing NULL char if received
+ ptr=buffer;
+ for (int i=0;i<got;i++,ptr++) {
+ if (*ptr=='\000')
+ *ptr='?';
+ }
soc->carin+=got; //managing carpile
soc->carpile[soc->carin]='\000';
}