More GSFormat fixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9036 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2001-02-07 18:17:41 +00:00
parent 90c95b763a
commit e8cf2df164
2 changed files with 11 additions and 7 deletions

View file

@ -1,3 +1,7 @@
2001-02-07 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSFormat.m: merged in some more fixes by Kai.
2001-02-07 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSFormat.m: Fixed error in PAD() macro - it was failing to

View file

@ -1122,6 +1122,7 @@ NSDictionary *locale)
/* Process format specifiers. */
while (1)
{
int string_malloced;
do
{
const void *ptr;
@ -1499,8 +1500,8 @@ NSDictionary *locale)
/* Make sure the full string "(nil)" is printed. */
if (prec < 5)
prec = 5;
is_long = 0; /* This is no wide-char string. */
goto LABEL (print_string);
string_malloced = 0;
goto LABEL (print_uni_string);
}
}
/* NOTREACHED */
@ -1524,8 +1525,7 @@ NSDictionary *locale)
LABEL (form_strerror):
/* Print description of error ERRNO. */
string =
(unichar *) __strerror_r (save_errno, (char *) work_buffer,
sizeof work_buffer);
(unichar *) strerror(save_errno);
is_long = 0; /* This is no wide-char string. */
goto LABEL (print_string);
LABEL (form_character):
@ -1556,7 +1556,6 @@ NSDictionary *locale)
LABEL (form_string):
{
size_t len;
int string_malloced;
/* The string argument could in fact be `char *' or `wchar_t *'.
But this should not make a difference here. */
@ -1633,6 +1632,7 @@ NSDictionary *locale)
while (prc--) *sp = *wsp;
}
LABEL (print_uni_string):
if ((width -= len) <= 0)
{
outstring (string, len);
@ -1652,7 +1652,6 @@ NSDictionary *locale)
LABEL (form_object):
{
size_t len;
int string_malloced;
id obj;
NSString *dsc;
@ -1672,7 +1671,8 @@ NSDictionary *locale)
NSString into a unicode string. */
NSRange r;
len = prec != -1 ? prec : [dsc length];
len = [dsc length];
if (prec >= 0 && prec < len) len = prec;
/* Allocate dynamically an array which definitely is long
enough for the wide character version. */