diff options
author | Riccardo Spagni <ric@spagni.net> | 2014-09-25 08:24:42 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2014-09-25 08:24:42 +0200 |
commit | 59a8366bb18653f14142321a9d85377ceaef8fad (patch) | |
tree | bad5d2d8ce4e7fa651b7e03a4e749a823032a0f2 /src/common | |
parent | Merge pull request #160 from tewinget/remove_ldns_dep (diff) | |
download | monero-59a8366bb18653f14142321a9d85377ceaef8fad.tar.xz |
Revert "low risk, potentially varint overflow bug patched thanks to BBR"
This reverts commit 4e2b2b942daa4206ec44c66e59863670dfe3fde4.
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/varint.h | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/src/common/varint.h b/src/common/varint.h index 57386597a..5a73c2746 100644 --- a/src/common/varint.h +++ b/src/common/varint.h @@ -36,7 +36,7 @@ #include <sstream> #include <string> /*! \file varint.h - * \brief provides the implementation of varint's + * \breif provides the implementation of varint's * * The representation of varints is rather odd. The first bit of each * octet is significant, it represents wheter there is another part @@ -52,29 +52,6 @@ namespace tools { - template<typename T> - size_t get_varint_packed_size(T v) - { - if(v <= 127) - return 1; - else if(v <= 16383) - return 2; - else if(v <= 2097151) - return 3; - else if(v <= 268435455) - return 4; - else if(v <= 34359738367) - return 5; - else if(v <= 4398046511103) - return 6; - else if(v <= 4398046511103) - return 6; - else if(v <= 562949953421311) - return 7; - else - return 8; - } - /*! \brief Error codes for varint */ enum { |