* Cameron Simpson ([EMAIL PROTECTED]) wrote:
> On Mon, Feb 28, 2000 at 11:29:41PM +0000, Tom Gilbert wrote:
> | > Show us the code. Better still, first winnow it down to as small an example
> | > as you can and still have it fail. And then show us the code.
> |
> | Seen it now. The offending line was:
> | #define PATH_VARIABLE_NAME "TTSDATA"
> | [...]
> | strcpy(task_filename, getenv(PATH_VARIABLE_NAME));
> | On his Sun system, the environment variable TTSDATA is defined, on his
> | linux box, it is not :)
> | That's where it segfaults. getenv returns NULL and the first strlen()
> | in strcpy() dumps core.
> | So it's not a Sun/Linux thing, it's an environment thing :)
>
> Bleah. No, it's a _classic_ example of unchecked calls. getenv() can always
> return NULL - there's NO excuse for not checking.
Hehe. well, thanks for pointing out the obvious ;)
I was just too nice to say it on the list ;)
Tom.
--
.-------------------------------------------------------.
.^. | Tom Gilbert, England | [EMAIL PROTECTED] |
/V\ |----------------------| www.tomgilbert.freeserve.co.uk |
// \\ | Sites I recommend: `--------------------------------|
/( )\ | www.freshmeat.net www.enlightenment.org slashdot.org |
^^-^^ `-------------------------------------------------------'
--
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.