summaryrefslogtreecommitdiff
path: root/buf.c
diff options
context:
space:
mode:
Diffstat (limited to 'buf.c')
-rw-r--r--buf.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/buf.c b/buf.c
index 440ac76..d0519e5 100644
--- a/buf.c
+++ b/buf.c
@@ -11,6 +11,21 @@ buf_t* buf_init()
}
+int buf_not_null( buf_t *bf )
+{
+
+ if ( bf == NULL )
+ return 0;
+
+ if ( bf->buf == NULL )
+ return 0;
+
+ if ( bf->buf_size < 0 )
+ return 0;
+
+ return 1;
+}
+
int buf_size( buf_t *bf, int size )
{
if (bf->buf != NULL)