[Pcsclite-cvs-commit] r2043 - trunk/HandlerTest/Host

Ludovic Rousseau rousseau at costa.debian.org
Fri May 12 19:17:17 UTC 2006


Author: rousseau
Date: 2006-05-12 19:17:13 +0000 (Fri, 12 May 2006)
New Revision: 2043

Modified:
   trunk/HandlerTest/Host/debug.c
Log:
do not use a buffer anymore since we may log extended APDU (64KB) and we
do not need a buffer in the first place


Modified: trunk/HandlerTest/Host/debug.c
===================================================================
--- trunk/HandlerTest/Host/debug.c	2006-05-12 13:51:21 UTC (rev 2042)
+++ trunk/HandlerTest/Host/debug.c	2006-05-12 19:17:13 UTC (rev 2043)
@@ -14,38 +14,26 @@
 #include <stdio.h>
 #include <string.h>
 
-#define DEBUG_BUF_SIZE 4096
-
-static char DebugBuffer[DEBUG_BUF_SIZE];
-
 void log_msg(const int priority, char *fmt, ...)
 {
 	va_list argptr;
 
 	va_start(argptr, fmt);
-	vsnprintf(DebugBuffer, DEBUG_BUF_SIZE, fmt, argptr);
+	vprintf(fmt, argptr);
 	va_end(argptr);
-
-	fprintf(stdout, "%s\n", DebugBuffer);
+	printf("\n");
 } /* log_msg */
 
 void log_xxd(const int priority, const char *msg, const unsigned char *buffer,
 	const int len)
 {
 	int i;
-	char *c, *debug_buf_end;
 
-	debug_buf_end = DebugBuffer + DEBUG_BUF_SIZE - 5;
+	printf(msg);
 
-	strncpy(DebugBuffer, msg, sizeof(DebugBuffer)-1);
-	c = DebugBuffer + strlen(DebugBuffer);
+	for (i = 0; i < len; ++i)
+		printf("%02X ", buffer[i]);
 
-	for (i = 0; (i < len) && (c < debug_buf_end); ++i)
-	{
-		sprintf(c, "%02X ", buffer[i]);
-		c += strlen(c);
-	}
-
-	fprintf(stdout, "%s\n", DebugBuffer);
+	printf("\n");
 } /* log_xxd */
 




More information about the Pcsclite-cvs-commit mailing list