summaryrefslogtreecommitdiff
path: root/app/bin/lprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/bin/lprintf.c')
-rw-r--r--app/bin/lprintf.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/app/bin/lprintf.c b/app/bin/lprintf.c
index c0f1c00..217d904 100644
--- a/app/bin/lprintf.c
+++ b/app/bin/lprintf.c
@@ -1,5 +1,5 @@
-/*
- * $Header: /home/dmarkle/xtrkcad-fork-cvs/xtrkcad/app/bin/lprintf.c,v 1.2 2006-05-26 17:31:44 m_fischer Exp $
+/** \file lprintf.c
+ * Logging functions
*/
/* XTrkCad - Model Railroad CAD
@@ -23,6 +23,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <errno.h>
#ifndef WINDOWS
#include <time.h>
@@ -30,8 +31,14 @@
#include <time.h>
#include <sys/timeb.h>
#endif
+
+#include "custom.h"
+#include "fileio.h"
+#include "messages.h"
+#include "paths.h"
#include "track.h"
+
/****************************************************************************
*
* LPRINTF
@@ -72,8 +79,7 @@ static void LogDoOpen( void )
{
if ( logFileName == NULL ) {
#ifdef WINDOWS
- logFileName = (char*)MyMalloc( strlen(wGetAppWorkDir()) + 1 + strlen("xtclog.txt") + 1);
- sprintf( logFileName, "%s%s%s", wGetAppWorkDir(), FILE_SEP_CHAR, "xtclog.txt" );
+ MakeFullpath(&logFileName, wGetAppWorkDir(), "xtclog.txt", NULL);
#else
logFile = stdout;
#endif
@@ -115,7 +121,7 @@ EXPORT void LogSet( char * name, int level )
EXPORT int LogFindIndex( char * name )
{
int inx;
- for ( inx=11; inx<logTable_da.cnt; inx++ )
+ for ( inx=0; inx<logTable_da.cnt; inx++ )
if ( strcasecmp( logTable(inx).name, name ) == 0 )
return inx;
return 0;