aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/nifs/common/socket_tarray.c
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2018-07-31 12:53:52 +0200
committerMicael Karlberg <[email protected]>2018-09-18 14:50:18 +0200
commitd4c6b555aea77198d662822c7f5a134a16cff8af (patch)
tree51fbbc59bd11e850f866b95f41cccaebdc3f186c /erts/emulator/nifs/common/socket_tarray.c
parent165666d8b8b1b21ffaf43ac436cfc1657ba83649 (diff)
downloadotp-d4c6b555aea77198d662822c7f5a134a16cff8af.tar.gz
otp-d4c6b555aea77198d662822c7f5a134a16cff8af.tar.bz2
otp-d4c6b555aea77198d662822c7f5a134a16cff8af.zip
[socket-nif] Debugged and stuff
It seems to work, with atleast some of the cmsg options. More testing needed... OTP-14831
Diffstat (limited to 'erts/emulator/nifs/common/socket_tarray.c')
-rw-r--r--erts/emulator/nifs/common/socket_tarray.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/erts/emulator/nifs/common/socket_tarray.c b/erts/emulator/nifs/common/socket_tarray.c
index bf37e5bc0e..a327e014c4 100644
--- a/erts/emulator/nifs/common/socket_tarray.c
+++ b/erts/emulator/nifs/common/socket_tarray.c
@@ -63,13 +63,13 @@ void* esock_tarray_create(uint32_t sz)
{
SocketTArrayInt* tarrayP;
- ESOCK_ASSERT( (sz == 0) );
+ ESOCK_ASSERT( (sz > 0) );
tarrayP = MALLOC(sizeof(SocketTArrayInt));
- ESOCK_ASSERT( (tarrayP == NULL) );
+ ESOCK_ASSERT( (tarrayP != NULL) );
tarrayP->array = MALLOC(sz * sizeof(ERL_NIF_TERM));
- ESOCK_ASSERT( (tarrayP->array == NULL) );
+ ESOCK_ASSERT( (tarrayP->array != NULL) );
tarrayP->sz = sz;
tarrayP->idx = 0;
@@ -131,7 +131,7 @@ void esock_tarray_ensure_fits(SocketTArrayInt* taP, uint32_t needs)
uint32_t newSz = (needs < taP->sz) ? 2*taP->sz : 2*needs;
void* mem = REALLOC(taP->array, newSz * sizeof(ERL_NIF_TERM));
- ESOCK_ASSERT( (mem == NULL) );
+ ESOCK_ASSERT( (mem != NULL) );
taP->sz = newSz;
taP->array = (ERL_NIF_TERM*) mem;