You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Scott A. Herod" <he...@interact-tv.com> on 2001/03/09 20:13:40 UTC

Re: [Fwd: [Bug 733] Changed - Seg fault when trying to parse empty filename]

Bad form to reply to myself, but I should have added that the second
way works in the test script in g++ egcs-2.91.66.

"Scott A. Herod" wrote:
> 
> Sorry if this is not the correct way to respond to this.
> 
> I'm not a great C programmer, but doesn't
> 
> unsigned short* x = '\x00';
> 
> set x to NULL.  ( x doesn't point to NULL but is zero ).
> What I think you want is
> 
> unsigned short* x;
> *x = '\x00';
> 
> That is x is a pointer to a ushort and it points to NULL;
> 
> Scott
> 
> bugzilla@apache.org wrote:
> >
> > ! ------- Additional Comments From tng@ca.ibm.com  2001-03-09 09:23 -------
> > ! This only happens in Linux.  Here is a sample code that reproduce the core dump:
> > !
> > ! test.cpp
> > ! ========
> > ! #include <stdio.h>
> > ! int main() {
> > !  unsigned short* x = '\x00';
> > !  if(!*x)
> > !    printf("hello\n");
> > !  return 0;
> > ! }
> > !
> > ! Running above problem under platforms like AIX or Windows, "hello" can be
> > ! printed successfully.  But with Linux, the "if(!*x)" gives core dump.
> > !
> > ! Is this a Linux problem?

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org