deps/kb_meme/meme-5.0.1/src/buffer.c
/*
 * buf_set_limit
 * sets the limit, the new limit must be non-negative 
 * and smaller than the buffer's capacity
 */
buf_set_limit
sets the limit, the new limit must be non-negative
and smaller than the buffer's capacity
buf_set_limit sets the limit the new limit must be non - negative and smaller than the buffer ' s capacity
void buf_set_limit(BUF_T *buf, int limit) {
  if (limit < 0 || limit > buf->capacity) {
    die("limit out of bounds\n");
  }
  if (buf->position > limit) {
    buf->position = limit;
    if (buf->mark > limit) buf->mark = -1;
  }
  buf->limit = limit;
}
void buf_set_limit ( BUF_T * buf , int limit ) { if ( limit < 0 || limit > buf -> capacity ) { die ( " \n " ) ; } if ( buf -> position > limit ) { buf -> position = limit ; if ( buf -> mark > limit ) buf -> mark = -1 ; } buf -> limit = limit ; }
buf_set_limit
 sets the limit, the new limit must be non-negative
 and smaller than the buffer's capacity
buf_set_limit sets the limit the new limit must be non - negative and smaller than the buffer ' s capacity