summaryrefslogtreecommitdiff
blob: c3f98c713d015774e89b1e532ea85fd352a201c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
allow negative integers ... should fix random "error, initial meta info failed"

https://sourceforge.net/tracker/?func=detail&aid=3159066&group_id=202532&atid=981959

--- ctorrent-dnh3.3.2/bencode.cpp
+++ ctorrent-dnh3.3.2/bencode.cpp
@@ -44,6 +44,10 @@
     p++; len--;
   }
 
+  if( *p == '-'){
+    p++; len--;
+  }
+
   for(psave = p; len && isdigit(*p); p++,len--) ;
 
   if(!len || MAX_INT_SIZ < (p - psave) || *p != endchar) return 0;