summaryrefslogtreecommitdiff
path: root/src/libstddjb/bufalloc_clean.c
blob: 2b78f39c65cf5e1a4f8faba1d6c7c84a588a862f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* ISC license. */

#include <string.h>
#include <skalibs/bufalloc.h>

void bufalloc_clean (register bufalloc *ba)
{
  if (ba->p)
  {
    memmove(ba->x.s, ba->x.s + ba->p, ba->x.len - ba->p) ;
    ba->x.len -= ba->p ;
    ba->p = 0 ;
  }
}