Skip to content

Commit

Permalink
Missing size_t declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
sneves committed Mar 22, 2016
1 parent ccd37c8 commit 02bdff7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/encoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,15 +411,16 @@ int encode_string(char *dst, size_t dst_len, argon2_context *ctx,
#undef SB
}

uint32_t b64len(uint32_t len) {
size_t b64len(uint32_t len) {
return ((len + 2) / 3) * 4;
}

uint32_t numlen(uint32_t num) {
uint32_t len = 1;
size_t numlen(uint32_t num) {
size_t len = 1;
while (num >= 10) {
++len;
num = num / 10;
}
return len;
}

4 changes: 2 additions & 2 deletions src/encoding.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ int encode_string(char *dst, size_t dst_len, argon2_context *ctx,
int decode_string(argon2_context *ctx, const char *str, argon2_type type);

/* Returns the length of the encoded byte stream with length len */
uint32_t b64len(uint32_t len);
size_t b64len(uint32_t len);

/* Returns the length of the encoded number num */
uint32_t numlen(uint32_t num);
size_t numlen(uint32_t num);

#endif

0 comments on commit 02bdff7

Please sign in to comment.