strerror(), errno and syslog()

2005-08-25 Thread Samuel Thibault
Hi, This crashes (yes it's odd code, but it shouldn't crash): #include #include int main(void) { errno = -1; syslog(LOG_ERR,"foo"); } Indeed, one of the first things that vsyslog does is char *errtext = strerror (get_errno ()); int errlen = strlen (errtext);

Re: strerror(), errno and syslog()

2005-08-25 Thread Corinna Vinschen
On Aug 25 23:34, Samuel Thibault wrote: > Hi, > > This crashes (yes it's odd code, but it shouldn't crash): > > #include > #include > > int main(void) { > errno = -1; > syslog(LOG_ERR,"foo"); > } > > Indeed, one of the first things that vsyslog does is > > char *errtext = s