[Pcsclite-cvs-commit] r2049 - trunk/PCSC/src

Ludovic Rousseau rousseau at costa.debian.org
Sat May 20 14:25:07 UTC 2006


Author: rousseau
Date: 2006-05-20 14:25:07 +0000 (Sat, 20 May 2006)
New Revision: 2049

Modified:
   trunk/PCSC/src/debuglog.c
Log:
log_xxd(): if the buffer is too small then end it with "..."


Modified: trunk/PCSC/src/debuglog.c
===================================================================
--- trunk/PCSC/src/debuglog.c	2006-05-19 12:18:49 UTC (rev 2048)
+++ trunk/PCSC/src/debuglog.c	2006-05-20 14:25:07 UTC (rev 2049)
@@ -131,6 +131,10 @@
 		c += strlen(c);
 	}
 
+	/* the buffer is too small so end it with "..." */
+	if ((c >= debug_buf_end) && (i < len))
+		c[-3] = c[-2] = c[-1] = '.';
+
 #ifndef WIN32
 	if (DEBUGLOG_SYSLOG_DEBUG == LogMsgType)
 		syslog(LOG_INFO, "%s", DebugBuffer);




More information about the Pcsclite-cvs-commit mailing list