[Pcsclite-cvs-commit] r1629 - trunk/PCSC/src
Ludovic Rousseau
rousseau at costa.debian.org
Thu Sep 1 08:25:50 UTC 2005
Author: rousseau
Date: 2005-09-01 08:25:50 +0000 (Thu, 01 Sep 2005)
New Revision: 1629
Modified:
trunk/PCSC/src/readerfactory.c
Log:
RFAddReader(): correct max length tests for reader, library and device
I was too pessimistic
Modified: trunk/PCSC/src/readerfactory.c
===================================================================
--- trunk/PCSC/src/readerfactory.c 2005-08-31 14:58:19 UTC (rev 1628)
+++ trunk/PCSC/src/readerfactory.c 2005-09-01 08:25:50 UTC (rev 1629)
@@ -78,26 +78,26 @@
return SCARD_E_INVALID_VALUE;
/* Reader name too long? */
- if (strlen(lpcReader) >= MAX_READERNAME-1) /* -1 because of \0 */
+ if (strlen(lpcReader) >= MAX_READERNAME)
{
Log3(PCSC_LOG_ERROR, "Reader name too long: %d chars instead of max %d",
- strlen(lpcReader), MAX_READERNAME-1);
+ strlen(lpcReader), MAX_READERNAME);
return SCARD_E_INVALID_VALUE;
}
/* Library name too long? */
- if (strlen(lpcLibrary) >= MAX_LIBNAME-1) /* -1 because of \0 */
+ if (strlen(lpcLibrary) >= MAX_LIBNAME)
{
Log3(PCSC_LOG_ERROR, "Library name too long: %d chars instead of max %d",
- strlen(lpcLibrary), MAX_LIBNAME-1-1);
+ strlen(lpcLibrary), MAX_LIBNAME);
return SCARD_E_INVALID_VALUE;
}
/* Device name too long? */
- if (strlen(lpcDevice) >= MAX_DEVICENAME-1) /* -1 because of \0 */
+ if (strlen(lpcDevice) >= MAX_DEVICENAME)
{
Log3(PCSC_LOG_ERROR, "Device name too long: %d chars instead of max %d",
- strlen(lpcDevice), MAX_DEVICENAME-1);
+ strlen(lpcDevice), MAX_DEVICENAME);
return SCARD_E_INVALID_VALUE;
}
More information about the Pcsclite-cvs-commit
mailing list