Re: [vdr] strcmp() segfaults if one (and only one) of the parameters is NULL ?

2011-07-05 Thread Tony Houghton
On Tue, 5 Jul 2011 15:40:14 +0200 sundararaj reel wrote: > strcmp() returns 0 if both are parameters NULL, but segfaults if one > of the parameters is NULL. I think that's officially undefined behaviour. The easiest workaround (in the absence of something like glib which provides NULL-safe versi

[vdr] strcmp() segfaults if one (and only one) of the parameters is NULL ?

2011-07-05 Thread sundararaj reel
Hi, strcmp() returns 0 if both are parameters NULL, but segfaults if one of the parameters is NULL. Is this a known behaviour ? man page says nothing about NULL parameters. I ask because, vdr checks for NULL parameter(s) to strcmp() sometimes. Check for one or both parameters: epg.c:692: if (s