Re: SEG in THtml::MakeClass()

Nenad BUNCIC (Nenad.Buncic@cern.ch)
Mon, 2 Jun 97 22:32:11 +0200


> Char_t *htmlFile = GetHtmlFileName( classPtr );
> if( !strncmp( htmlFile, "http://", 7 )) htmlFile = NULL;
Patrick, thanks for reporting the problem.

> if( htmlFile ) {
>
>THtml::GetHtmlFileName() returns a NULL when it can't find the file. so
>the strncmp() also needs to be protected from testing a NULL pointer.

'int strcmp( const char *s1, const char *s2 )' is C library
function, and according to standard only NULL pointer for destination
string will cause undefined behavior. However, we are aware of the fact
that some 'libc' implementations are different.

>loop over all classes and skip the ones it can't find the source code to.

That's exactly what it does.

>related question: why is gHtml only initialized when one constructs a
>THtml object anyway?

This is just a leftover from previous implementation, and it
doesn't exist anymore.

------------------------------------------------------------
Nenad BUNCIC email: Nenad.Buncic@cern.ch
CERN, PPE Division/NA49 phone: ( +41 22 76 ) 76462
CH-1211 Geneva 23 ( +41 22 76 ) 74921
SWITZERLAND fax: ( +41 22 76 ) 77910
------------------------------------------------------------
C E R N European Laboratory for Particle Physics
------------------------------------------------------------