packages/net/ctorrent/patches/100-negative-ints.patch
tripolar 9796959bf1 [packages/ctorrent] allow negative integers ... should fix random "error, initial meta info failed"
taken from this bugreport:
http://sourceforge.net/tracker/?func=detail&aid=3159066&group_id=202532&atid=981959

thanks Norbert Zagyi <znorbi@znorbi.net> for the hint


git-svn-id: svn://svn.openwrt.org/openwrt/packages@35041 3c298f89-4303-0410-b956-a3cf2f4a3e73
2013-01-07 16:44:58 +00:00

14 lines
284 B
Diff

--- a/bencode.cpp
+++ b/bencode.cpp
@@ -44,6 +44,10 @@ size_t buf_long(const char *b,size_t len
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;