From 8894671a435fb05a3a92bbf29b7094ba5ab893c4 Mon Sep 17 00:00:00 2001 From: CaS Date: Wed, 20 Mar 2002 17:09:03 +0000 Subject: [PATCH] Lossy conversion fix. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13178 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 2 ++ Source/Unicode.m | 4 ++-- Testing/nsconnection_client.m | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 89f19d6a3..ea7ee0486 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,8 @@ * Source/UnixFileHandle.m: Fix to return gdomap port even if getservbyname() doesn't. * Source/NSTask.m: Try appending .exe extension to paths under windoze. + * Source/Unicode.m: GSFromUnicode() fix lossy conversion for cases + where output encoding can't handle the unicode. 2002-03-19 Richard Frith-Macdonald diff --git a/Source/Unicode.m b/Source/Unicode.m index 07d84b963..ae96ead75 100644 --- a/Source/Unicode.m +++ b/Source/Unicode.m @@ -2150,8 +2150,8 @@ tables: { *outbuf++ = '*'; outbytesleft--; - inbuf++; - inbytesleft--; + inbuf += sizeof(unichar); + inbytesleft -= sizeof(unichar); } } else if (errno != E2BIG) diff --git a/Testing/nsconnection_client.m b/Testing/nsconnection_client.m index 08f567cd8..622d6a780 100644 --- a/Testing/nsconnection_client.m +++ b/Testing/nsconnection_client.m @@ -450,8 +450,10 @@ int main (int argc, char *argv[], char **env) exit(0); break; default: +#if 0 usage(argv[0]); exit(1); +#endif break; } if (type_test == NO_TEST) @@ -477,8 +479,7 @@ int main (int argc, char *argv[], char **env) } else prx = [NSConnection rootProxyForConnectionWithRegisteredName: - @"test2server" - host:nil]; + @"test2server" host: @"*"]; if (prx == nil) { printf("ERROR: Failed to connect to server\n");