Syslog crash when used in a win32 dll with VisualStudio.
Does work when used inside a static library.
- create a dll using/including syslog.c client side with mingw
- with VisualStudio create a simple exec that use this dll generating a .lib with libtool
- in the dll, emit a log with syslog(...)
- see crash
Here it is I have found the root cause:
in init_logger_addr():
line : strcpy( pathname, argv[0] );
argv seems null when syslog-client.c inside a dll.
Adding:
if (!__argv)
goto use_default;
fixes the crash.