diff options
| author | Stef Walter <stef@memberwebs.com> | 2008-12-01 19:27:02 +0000 | 
|---|---|---|
| committer | Stef Walter <stef@memberwebs.com> | 2008-12-01 19:27:02 +0000 | 
| commit | f2637dea1ef8646bac64f2041c6da223f75dfc75 (patch) | |
| tree | c319c6491fe96c614904686ec4591b3601243371 /ckcapi.c | |
| parent | 014f22be6a744dd3d116476d95009dd654333311 (diff) | |
Add support for building on VC 2005, and remove support for old MSVC.
Diffstat (limited to 'ckcapi.c')
| -rw-r--r-- | ckcapi.c | 17 | 
1 files changed, 13 insertions, 4 deletions
| @@ -23,6 +23,9 @@  #include "ckcapi.h" +/* Warns about all the raw string usage in this file */ +#pragma warning (disable : 4996) +  /* -------------------------------------------------------------------   * GLOBALS / DEFINES    */ @@ -47,18 +50,24 @@ static HANDLE global_mutex = NULL;   * MODULE GLOBAL FUNCTIONS   */ +#define LINE 1024 +  void   ckcapi_debug(const char* msg, ...)  { -	char buf[1024]; +	char buf[LINE];  	va_list va; +	size_t len;  	va_start(va, msg);  	_vsnprintf(buf, 1024, msg, va);  	va_end(va); -	strncat(buf, "\n", 1024); -	buf[1024 - 1] = 0; +	buf[LINE - 1] = 0; +	len = strlen (buf); + +	strncpy(buf + len, "\n", 1024 - len); +	buf[LINE - 1] = 0;  	OutputDebugStringA(buf);  } @@ -262,7 +271,7 @@ CC_C_GetSlotList(CK_BBOOL tokenPresent, CK_SLOT_ID_PTR slot_list, CK_ULONG_PTR c  	*count = n_tokens;  	for(i = 0; i < n_tokens; ++i) -		slot_list[i] = i; +		slot_list[i] = ckcapi_token_get_slot_id (i);  	RETURN(CKR_OK);  } | 
