summary refs log tree commit diff
path: root/src/libstddjb/buffer_getallnf.c
blob: be46196dd5c09ed7a0a9e8e8653e0c24827cf0b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* ISC license. */

#include <errno.h>
#include <skalibs/buffer.h>

int buffer_getallnofill (buffer *b, char *s, unsigned int len)
{
  register unsigned int r = buffer_getnofill(b, s, len) ;
  if (r < len)
  {
    buffer_unget(b, r) ;
    return (errno = ENOBUFS, 0) ;
  }
  return 1 ;
}