diff options
Diffstat (limited to 'src/libstddjb/cdbmake_posplus.c')
-rw-r--r-- | src/libstddjb/cdbmake_posplus.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libstddjb/cdbmake_posplus.c b/src/libstddjb/cdbmake_posplus.c new file mode 100644 index 0000000..a2f4468 --- /dev/null +++ b/src/libstddjb/cdbmake_posplus.c @@ -0,0 +1,14 @@ +/* ISC license. */ + +#include <stdint.h> +#include <errno.h> + +#include "cdbmake-internal.h" + +int cdbmake_posplus (cdbmaker *c, uint32_t len) +{ + uint32_t newpos = c->pos + len ; + if (newpos < len) return (errno = ENOMEM, 0) ; + c->pos = newpos ; + return 1 ; +} |