2001-02-11 Manuel Guesdon <mguesdon@orange-concept.com>

* GSXML.m: testing lib!=NULL and string!=NULL before doing something in
                -GSXMLNode content
                -GSXMLNode name
                -GSXMLNode ns
                -GSXMLNode nsDef
	* NSString.m: handle NULL bytes in -initWithUTF8String: (Treat it as zero
		length string and NSDebugMLog a warning).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9124 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mguesdon 2001-02-11 22:45:01 +00:00
parent ae034e342b
commit baf0ff4254
3 changed files with 21 additions and 5 deletions

View file

@ -1,3 +1,13 @@
2001-02-11 Manuel Guesdon <mguesdon@orange-concept.com>
* GSXML.m: testing lib!=NULL and string!=NULL before doing something in
-GSXMLNode content
-GSXMLNode name
-GSXMLNode ns
-GSXMLNode nsDef
* NSString.m: handle NULL bytes in -initWithUTF8String: (Treat it as zero
length string and NSDebugMLog a warning).
2001-02-09 Jonathan Gapen <jagapen@home.com> 2001-02-09 Jonathan Gapen <jagapen@home.com>
More FreeBSD build fixes: More FreeBSD build fixes:

View file

@ -531,7 +531,7 @@ static NSMapTable *nodeNames = 0;
- (NSString*) content - (NSString*) content
{ {
if (((xmlNodePtr)lib)->content != NULL) if (lib != NULL && ((xmlNodePtr)lib)->content!=NULL)
{ {
return UTF8Str(((xmlNodePtr)lib)->content); return UTF8Str(((xmlNodePtr)lib)->content);
} }
@ -543,7 +543,7 @@ static NSMapTable *nodeNames = 0;
- (NSString*) name - (NSString*) name
{ {
if (lib != NULL) if (lib != NULL && ((xmlNodePtr)lib)->name!=NULL)
{ {
return UTF8Str(((xmlNodePtr)lib)->name); return UTF8Str(((xmlNodePtr)lib)->name);
} }
@ -555,7 +555,7 @@ static NSMapTable *nodeNames = 0;
- (GSXMLNamespace*) ns - (GSXMLNamespace*) ns
{ {
if (((xmlNodePtr)(lib))->ns != NULL) if (lib != NULL && ((xmlNodePtr)(lib))->ns != NULL)
{ {
return [GSXMLNamespace namespaceFrom: ((xmlNodePtr)(lib))->ns]; return [GSXMLNamespace namespaceFrom: ((xmlNodePtr)(lib))->ns];
} }
@ -567,7 +567,7 @@ static NSMapTable *nodeNames = 0;
- (GSXMLNamespace*) nsDef - (GSXMLNamespace*) nsDef
{ {
if (((xmlNodePtr)lib)->nsDef != NULL) if (lib != NULL && ((xmlNodePtr)lib)->nsDef != NULL)
{ {
return [GSXMLNamespace namespaceFrom: ((xmlNodePtr)lib)->nsDef]; return [GSXMLNamespace namespaceFrom: ((xmlNodePtr)lib)->nsDef];
} }

View file

@ -605,7 +605,13 @@ handle_printf_atsign (FILE *stream,
- (id) initWithUTF8String: (const char *)bytes - (id) initWithUTF8String: (const char *)bytes
{ {
unsigned length = strlen(bytes); unsigned length = 0;
if (bytes==NULL)
{
NSDebugMLog(@"bytes is NULL");
}
else
length=strlen(bytes);
if (length > 0) if (length > 0)
{ {