summaryrefslogtreecommitdiff
path: root/src/shared/dlt_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/dlt_common.c')
-rw-r--r--src/shared/dlt_common.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/shared/dlt_common.c b/src/shared/dlt_common.c
index ce2d3f4..192f5d8 100644
--- a/src/shared/dlt_common.c
+++ b/src/shared/dlt_common.c
@@ -2614,6 +2614,21 @@ void dlt_buffer_read_block(DltBuffer *buf, int *read, unsigned char *data, unsig
}
}
+int dlt_buffer_check_size(DltBuffer *buf, int needed)
+{
+ if (buf == NULL)
+ {
+ return DLT_RETURN_WRONG_PARAMETER;
+ }
+
+ if ((buf->size + sizeof(DltBufferHead) + needed) > buf->max_size)
+ {
+ return DLT_RETURN_ERROR;
+ }
+
+ return DLT_RETURN_OK;
+}
+
int dlt_buffer_increase_size(DltBuffer *buf)
{
DltBufferHead *head,*new_head;