4444#include <stdlib.h>
4545#include <string.h>
4646#include <unistd.h>
47+ #include <assert.h>
4748
4849static const char Base64 [] =
4950 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" ;
@@ -129,10 +130,10 @@ size_t base64_encode(char const *src, size_t srclength, char *target, size_t tar
129130 output [1 ] = ((input [0 ] & 0x03 ) << 4 ) + (input [1 ] >> 4 );
130131 output [2 ] = ((input [1 ] & 0x0f ) << 2 ) + (input [2 ] >> 6 );
131132 output [3 ] = input [2 ] & 0x3f ;
132- soft_assert (output [0 ] < 64 );
133- soft_assert (output [1 ] < 64 );
134- soft_assert (output [2 ] < 64 );
135- soft_assert (output [3 ] < 64 );
133+ assert (output [0 ] < 64 );
134+ assert (output [1 ] < 64 );
135+ assert (output [2 ] < 64 );
136+ assert (output [3 ] < 64 );
136137
137138 if (datalength + 4 > targsize )
138139 return (-1 );
@@ -152,9 +153,9 @@ size_t base64_encode(char const *src, size_t srclength, char *target, size_t tar
152153 output [0 ] = input [0 ] >> 2 ;
153154 output [1 ] = ((input [0 ] & 0x03 ) << 4 ) + (input [1 ] >> 4 );
154155 output [2 ] = ((input [1 ] & 0x0f ) << 2 ) + (input [2 ] >> 6 );
155- soft_assert (output [0 ] < 64 );
156- soft_assert (output [1 ] < 64 );
157- soft_assert (output [2 ] < 64 );
156+ assert (output [0 ] < 64 );
157+ assert (output [1 ] < 64 );
158+ assert (output [2 ] < 64 );
158159
159160 if (datalength + 4 > targsize )
160161 return (-1 );
0 commit comments