Bug fixes
This commit is contained in:
parent
0723a85ab3
commit
44878e583a
3 changed files with 10 additions and 12 deletions
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue