summaryrefslogtreecommitdiff
path: root/src/buf_list_struct.c
diff options
context:
space:
mode:
authorJakub Sławiński2006-02-05 15:14:03 +0100
committerJoshua Judson Rosen2014-07-17 21:15:02 +0200
commitb457fec36399c1f7de093d5e92bb4fa453b79c86 (patch)
tree2084c9a78d40213015e6f10e3e9e01bc4c0c51f1 /src/buf_list_struct.c
parentUpdate copyright statements. (diff)
downloadapf-b457fec36399c1f7de093d5e92bb4fa453b79c86.tar.gz
v0.8
- Fixed: infinite loop after buffering message - Fixed: corrupt packets after closing connections in the stopped state - Fixed: bug in mapping user numbers between afclient and afserver - Fixed: premature close of the service connection - Fixed: invalid buffering when the connection is closing - Added: Multiple tunnels in one afclient<->afserver connection
Diffstat (limited to 'src/buf_list_struct.c')
-rw-r--r--src/buf_list_struct.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/buf_list_struct.c b/src/buf_list_struct.c
index 5df27fb..7de8acd 100644
--- a/src/buf_list_struct.c
+++ b/src/buf_list_struct.c
@@ -22,12 +22,13 @@
#include <stdlib.h>
#include <string.h>
+#include <assert.h>
#include "buf_list_struct.h"
/*
* Function name: BufList_new
- * Description: Create and initialize new BufList structure.
+ * Description: Creates and initializes new BufList structure.
* Returns: Newly created BufList structure.
*/
@@ -35,6 +36,7 @@ BufList*
BufList_new()
{
BufList* tmp = calloc(1, sizeof(BufList));
+ assert(tmp != NULL);
if (tmp == NULL) {
return NULL;
}
@@ -43,16 +45,18 @@ BufList_new()
/*
* Function name: BufList_free
- * Description: Free the memory allocated for BufList structure.
+ * Description: Frees the memory allocated for BufList structure.
* Arguments: bl - pointer to pointer to BufList structure.
*/
void
BufList_free(BufList** bl)
{
+ assert(bl != NULL);
if (bl == NULL) {
return;
}
+ assert((*bl) != NULL);
if ((*bl) == NULL) {
return;
}
@@ -63,7 +67,7 @@ BufList_free(BufList** bl)
/*
* Function name: BufList_insert_back
- * Description: Insert new node at the end of the list.
+ * Description: Inserts new node at the end of the list.
* Arguments: bl - pointer to BufList structure
* bln - pointer to BufListNode structure
*/
@@ -71,9 +75,11 @@ BufList_free(BufList** bl)
void
BufList_insert_back(BufList* bl, BufListNode* bln)
{
+ assert(bl != NULL);
if (bl == NULL) {
return;
}
+ assert(bln != NULL);
if (bln == NULL) {
return;
}
@@ -97,6 +103,7 @@ BufList_insert_back(BufList* bl, BufListNode* bln)
BufListNode*
BufList_get_first(BufList* bl)
{
+ assert(bl != NULL);
if (bl == NULL) {
return NULL;
}
@@ -113,6 +120,7 @@ void
BufList_delete_first(BufList* bl)
{
BufListNode* tmp = BufList_get_first(bl);
+ assert(tmp != NULL);
if (tmp == NULL) {
return;
}
@@ -134,6 +142,10 @@ BufList_delete_first(BufList* bl)
void
BufList_clear(BufList* bl)
{
+ assert(bl != NULL);
+ if (bl == NULL) {
+ return;
+ }
while (BufList_get_first(bl)) {
BufList_delete_first(bl);
}