Skip to content

Commit afd8ea0

Browse files
committed
libecdsaauth: use assert() instead of atheme's soft_assert().
1 parent a184a53 commit afd8ea0

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

libecdsaauth/base64.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <stdlib.h>
4545
#include <string.h>
4646
#include <unistd.h>
47+
#include <assert.h>
4748

4849
static 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

Comments
 (0)