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.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/app/bin/lprintf.c b/app/bin/lprintf.c
index 802fa24..0989ec9 100644
--- a/app/bin/lprintf.c
+++ b/app/bin/lprintf.c
@@ -17,7 +17,7 @@
*
* 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 "custom.h"
@@ -46,8 +46,9 @@ static void LogInit( void )
{
int inx=0;
- if ( logTable_da.cnt != 0 )
+ if ( logTable_da.cnt != 0 ) {
return;
+ }
DYNARR_APPEND( logTable_t, logTable_da,10);
logTable(inx).name = "";
logTable(inx).level = 0;
@@ -74,14 +75,17 @@ static void LogDoOpen( void )
if ( logFileName ) {
logFile = fopen( logFileName, "a" );
if ( logFile == NULL ) {
- NoticeMessage( MSG_OPEN_FAIL, "Continue", NULL, "Log", logFileName, strerror(errno) );
+ NoticeMessage( MSG_OPEN_FAIL, "Continue", NULL, "Log", logFileName,
+ strerror(errno) );
perror( logFileName );
return;
}
}
- fprintf( logFile, "# %s Version: %s, Date: %s\n", sProdName, sVersion, ctime(&logClock) );
- if ( recordF )
+ fprintf( logFile, "# %s Version: %s, Date: %s\n", sProdName, sVersion,
+ ctime(&logClock) );
+ if ( recordF ) {
fprintf( recordF, "# LOG CLOCK %s\n", ctime(&logClock) );
+ }
}
EXPORT void LogClose( void )
@@ -90,10 +94,11 @@ EXPORT void LogClose( void )
if ( logFile ) {
time(&clock);
fprintf( logFile, "LOG END %s\n", ctime(&clock) );
- if ( logFile != stdout )
+ if ( logFile != stdout ) {
fclose( logFile );
- }
- logFile = NULL;
+ }
+ }
+ logFile = NULL;
}
EXPORT void LogSet( char * name, int level )
@@ -109,22 +114,24 @@ EXPORT int LogFindIndex( const char * name )
{
int inx;
for ( inx=0; inx<logTable_da.cnt; inx++ )
- if ( strcasecmp( logTable(inx).name, name ) == 0 )
+ if ( strcasecmp( logTable(inx).name, name ) == 0 ) {
return inx;
+ }
return 0;
}
EXPORT void LogPrintf(
- const char * format,
- ... )
+ const char * format,
+ ... )
{
va_list ap;
if (!logInitted) {
LogDoOpen();
logInitted = TRUE;
}
- if ( logFile == NULL )
+ if ( logFile == NULL ) {
return;
+ }
logLineNumber++;
if ( logLineNumber % 100 == 0 ) {
if ( recordF ) {