-/* -*- mode: C; c-file-style: "gnu" -*- */
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* dbus-launch.c dbus-launch utility
*
* Copyright (C) 2007 Ralf Habacker <ralf.habacker@freenet.de>
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include <windows.h>
#include <string.h>
#include <assert.h>
-#ifdef __MINGW32__
+#if defined __MINGW32__ || (defined _MSC_VER && _MSC_VER <= 1310)
/* save string functions version
*/
#define errno_t int
-errno_t strcat_s(char *dest, int size, char *src)
+errno_t strcat_s(char *dest, size_t size, char *src)
{
assert(strlen(dest) + strlen(src) +1 <= size);
strcat(dest,src);
return 0;
}
-errno_t strcpy_s(char *dest, int size, char *src)
+errno_t strcpy_s(char *dest, size_t size, char *src)
{
assert(strlen(src) +1 <= size);
strcpy(dest,src);
showConsole = 1;
#endif
GetModuleFileName(NULL,dbusDaemonPath,sizeof(dbusDaemonPath));
- /* check for debug version */
- if (strstr(dbusDaemonPath,"dbus-launchd.exe"))
+
+#ifdef _DEBUG
daemon_name = "dbus-daemond.exe";
- else
+#else
daemon_name = "dbus-daemon.exe";
+#endif
if ((p = strrchr(dbusDaemonPath,'\\')))
{
*(p+1)= '\0';
if (result == 0)
{
if (verbose)
- fprintf(stderr,"could not start dbus-daemon error=%d",GetLastError());
+ fprintf(stderr, "Could not start dbus-daemon error=%d",GetLastError());
return 4;
}