crossroads

Git mirror of https://crossroads.e-tunity.com/
git clone git://git.finwo.net/app/crossroads
Log | Files | Refs | LICENSE

removeat.cc (298B)


      1 #include "netbuffer"
      2 
      3 bool Netbuffer::removeat(unsigned index, unsigned len) {
      4     if (index >= buf_sz)
      5 	return false;
      6 
      7     if (index + len >= buf_sz)
      8 	buf_sz = index;
      9     else {
     10 	memmove (buf_data + index, buf_data + index + len,
     11 		 buf_sz - index - len);
     12 	buf_sz -= len;
     13     }
     14     return true;
     15 }