cope with output of large integers

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37117 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2013-09-19 14:17:56 +00:00
parent 7607b307e2
commit 77415c00b5

View file

@ -891,7 +891,18 @@ writeObject(id obj, NSMutableString *output, NSInteger tabs)
}
else if ([obj isKindOfClass: NSNumberClass])
{
[output appendFormat: @"%g", [obj doubleValue]];
const char *t = [obj objCType];
if (strchr("cCsSiIlLqQ", *t) != 0)
{
long long i = [(NSNumber*)obj longLongValue];
[output appendFormat: @"%lld", i];
}
else
{
[output appendFormat: @"%g", [(NSNumber*)obj doubleValue]];
}
}
else if ([obj isKindOfClass: NSNullClass])
{