[Pcsclite-cvs-commit] CVS PCSC/src

CVS User rousseau ludovic.rousseau@free.fr
Mon, 28 Feb 2005 05:35:19 -0700


Update of /cvsroot/pcsclite/PCSC/src
In directory haydn:/tmp/cvs-serv12472

Modified Files:
	debuglog.c 
Log Message:
DebugLogSetLogType(): check the log type argument value


--- /cvsroot/pcsclite/PCSC/src/debuglog.c	2005/02/28 09:46:03	1.31
+++ /cvsroot/pcsclite/PCSC/src/debuglog.c	2005/02/28 12:35:18	1.32
@@ -7,7 +7,7 @@
  *  David Corcoran <corcoran@linuxnet.com>
  *  Ludovic Rousseau <ludovic.rousseau@free.fr>
  *
- * $Id: debuglog.c,v 1.31 2005/02/28 09:46:03 rousseau Exp $
+ * $Id: debuglog.c,v 1.32 2005/02/28 12:35:18 rousseau Exp $
  */
 
 #include "config.h"
@@ -145,6 +145,17 @@
 
 void DebugLogSetLogType(const int dbgtype)
 {
+	switch (dbgtype)
+	{
+		case DEBUGLOG_NO_DEBUG:
+		case DEBUGLOG_SYSLOG_DEBUG:
+		case DEBUGLOG_STDERR_DEBUG:
+			break;
+		default:
+			Log2(PCSC_LOG_CRITICAL, "unknown log type (%d), using stderr",
+				dbgtype);
+			dbgtype = DEBUGLOG_STDERR_DEBUG;
+	}
 	debug_msg_type = dbgtype;
 }