Fix for printing null pointer with %p

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14490 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2002-09-19 16:47:49 +00:00
parent 2af43e66f2
commit 23bdd51d7e
2 changed files with 4 additions and 9 deletions

View file

@ -1,5 +1,7 @@
2002-09-19 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSFormat.m: Where a %p format prints a null pointer,
print the text (null).
* Source/GSTcpHandle.m: Check port for invalidation while looping
on write events, so we can fail if we become invalid while sending
or connecting, before the port timeout expires.

View file

@ -1649,14 +1649,8 @@ NSDictionary *locale)
}
else
{
unichar nil_name[] = {'(','n','i','l',')','\0'};
/* Write "(nil)" for a nil pointer. */
string = nil_name;
/* Make sure the full string "(nil)" is printed. */
if (prec < 5)
prec = 5;
string_malloced = 0;
goto LABEL (print_uni_string);
string = NULL;
goto LABEL (print_string);
}
}
/* NOTREACHED */
@ -1788,7 +1782,6 @@ NSDictionary *locale)
while (prc--) *sp = *wsp;
}
LABEL (print_uni_string):
if ((width -= len) <= 0)
{
outstring (string, len);