[packages/ctorrent] allow negative integers ... should fix random "error, initial...
[openwrt/svn-archive/archive.git] / net / ctorrent / patches / 100-negative-ints.patch
1 --- a/bencode.cpp
2 +++ b/bencode.cpp
3 @@ -44,6 +44,10 @@ size_t buf_long(const char *b,size_t len
4 p++; len--;
5 }
6
7 + if( *p == '-'){
8 + p++; len--;
9 + }
10 +
11 for(psave = p; len && isdigit(*p); p++,len--) ;
12
13 if(!len || MAX_INT_SIZ < (p - psave) || *p != endchar) return 0;