[Pcsclite-cvs-commit] r5899 - /trunk/PCSC/src/debuglog.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Sun Aug 21 13:53:30 UTC 2011


Author: rousseau
Date: Sun Aug 21 13:53:30 2011
New Revision: 5899

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5899
Log:
Use sizeof instead of a hard coded value

Modified:
    trunk/PCSC/src/debuglog.c

Modified: trunk/PCSC/src/debuglog.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/debuglog.c?rev=5899&op=diff
==============================================================================
--- trunk/PCSC/src/debuglog.c (original)
+++ trunk/PCSC/src/debuglog.c Sun Aug 21 13:53:30 2011
@@ -104,7 +104,7 @@
 		return;
 
 	va_start(argptr, fmt);
-	vsnprintf(DebugBuffer, DEBUG_BUF_SIZE, fmt, argptr);
+	vsnprintf(DebugBuffer, sizeof DebugBuffer, fmt, argptr);
 	va_end(argptr);
 
 	log_line(priority, DebugBuffer);
@@ -182,7 +182,7 @@
 	char *c;
 	char *debug_buf_end;
 
-	debug_buf_end = DebugBuffer + DEBUG_BUF_SIZE - 5;
+	debug_buf_end = DebugBuffer + sizeof DebugBuffer - 5;
 
 	strlcpy(DebugBuffer, msg, sizeof(DebugBuffer));
 	c = DebugBuffer + strlen(DebugBuffer);
@@ -329,7 +329,7 @@
 		return;
 
 	va_start(argptr, fmt);
-	vsnprintf(DebugBuffer, DEBUG_BUF_SIZE, fmt, argptr);
+	vsnprintf(DebugBuffer, sizeof DebugBuffer, fmt, argptr);
 	va_end(argptr);
 
 	if (DEBUGLOG_SYSLOG_DEBUG == LogMsgType)




More information about the Pcsclite-cvs-commit mailing list