Bug fixes

This commit is contained in:
Adam Ierymenko 2019-09-11 16:10:06 -07:00
parent 0723a85ab3
commit 44878e583a
No known key found for this signature in database
GPG key ID: C8877CF2D7A5D7F3
3 changed files with 10 additions and 12 deletions

View file

@ -25,7 +25,7 @@
#include "SHA512.hpp"
#include "ECC384.hpp"
#define ZT_IDENTITY_STRING_BUFFER_LENGTH 512
#define ZT_IDENTITY_STRING_BUFFER_LENGTH 1024
namespace ZeroTier {

View file

@ -76,14 +76,12 @@ public:
* @return Pointer to s containing hex string with trailing zero byte
*/
template<typename I>
static ZT_ALWAYS_INLINE char *hex(I i,char *s)
static ZT_ALWAYS_INLINE char *hex(I x,char *s)
{
char *const r = s;
for(unsigned int i=0,b=(sizeof(i)*8);i<sizeof(i);++i) {
b -= 4;
*(s++) = HEXCHARS[(i >> b) & 0xf];
b -= 4;
*(s++) = HEXCHARS[(i >> b) & 0xf];
for(unsigned int i=0,b=(sizeof(x)*8);i<sizeof(x);++i) {
*(s++) = HEXCHARS[(x >> (b -= 4)) & 0xf];
*(s++) = HEXCHARS[(x >> (b -= 4)) & 0xf];
}
*s = (char)0;
return r;