Don't bencode signed integers as unsigned.
This commit is contained in:
parent
209eb5651a
commit
a3ca76cced
|
@ -187,7 +187,7 @@ static void __bencPrint( benc_val_t * val, int space )
|
||||||
switch( val->type )
|
switch( val->type )
|
||||||
{
|
{
|
||||||
case TYPE_INT:
|
case TYPE_INT:
|
||||||
fprintf( stderr, "int: %"PRIu64"\n", val->val.i );
|
fprintf( stderr, "int: %"PRId64"\n", val->val.i );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_STR:
|
case TYPE_STR:
|
||||||
|
@ -431,7 +431,7 @@ int tr_bencSave( benc_val_t * val, char ** buf, int * used, int * max )
|
||||||
switch( val->type )
|
switch( val->type )
|
||||||
{
|
{
|
||||||
case TYPE_INT:
|
case TYPE_INT:
|
||||||
if( tr_sprintf( buf, used, max, "i%"PRIu64"e", val->val.i ) )
|
if( tr_sprintf( buf, used, max, "i%"PRId64"e", val->val.i ) )
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,8 +32,11 @@ extern "C" {
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#ifndef PRId64
|
||||||
|
# define PRId64 "lld"
|
||||||
|
#endif
|
||||||
#ifndef PRIu64
|
#ifndef PRIu64
|
||||||
# define PRIu64 "lld"
|
# define PRIu64 "llu"
|
||||||
#endif
|
#endif
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue