diff --git a/rdp.c b/rdp.c index df4e6f1..7809548 100644 --- a/rdp.c +++ b/rdp.c @@ -246,7 +246,7 @@ int rdp_in_unistr(STREAM s, char *string, int str_size, int in_len) { #ifdef HAVE_ICONV - size_t ibl = in_len, obl = str_size-1; + size_t ibl = in_len, obl = str_size - 1; char *pin = (char *) s->p, *pout = string; static iconv_t iconv_h = (iconv_t) - 1; @@ -291,14 +291,14 @@ rdp_in_unistr(STREAM s, char *string, int str_size, int in_len) #endif { int i = 0; - int len = in_len/2; + int len = in_len / 2; int rem = 0; - if (len > str_size-1) + if (len > str_size - 1) { warning("server sent an unexpectedly long string, truncating\n"); - len = str_size-1; - rem = in_len - 2*len; + len = str_size - 1; + rem = in_len - 2 * len; } while (i < len) @@ -1350,10 +1350,10 @@ process_redirect_pdu(STREAM s /*, uint32 * ext_disc_reason */ ) in_uint32_le(s, len); /* read cookie string (plain ASCII) */ - if (len > sizeof(g_redirect_cookie)-1) + if (len > sizeof(g_redirect_cookie) - 1) { - uint32 rem = len - (sizeof(g_redirect_cookie)-1); - len = sizeof(g_redirect_cookie)-1; + uint32 rem = len - (sizeof(g_redirect_cookie) - 1); + len = sizeof(g_redirect_cookie) - 1; warning("Unexpectedly large redirection cookie\n"); in_uint8a(s, g_redirect_cookie, len); diff --git a/rdpdr.c b/rdpdr.c index d108934..d096dce 100644 --- a/rdpdr.c +++ b/rdpdr.c @@ -622,7 +622,8 @@ rdpdr_process_irp(STREAM s) in_uint8s(s, 0x17); if (length && length < 2 * 255) { - rdp_in_unistr(s, filename, sizeof(filename), length); + rdp_in_unistr(s, filename, sizeof(filename), + length); convert_to_unix_filename(filename); } else diff --git a/scard.c b/scard.c index faa0de2..071bca8 100644 --- a/scard.c +++ b/scard.c @@ -1420,9 +1420,10 @@ copyIORequest_MyPCSCToServer(MYPCSC_LPSCARD_IO_REQUEST src, SERVER_LPSCARD_IO_RE size_t bytesToCopy = src->cbPciLength - sizeof(MYPCSC_SCARD_IO_REQUEST); srcBytes = ((unsigned char *) src + sizeof(MYPCSC_SCARD_IO_REQUEST)); dstBytes = ((unsigned char *) dst + sizeof(SERVER_SCARD_IO_REQUEST)); - dst->dwProtocol = swap32((uint32_t)src->dwProtocol); - dst->cbPciLength = swap32((uint32_t)src->cbPciLength - - sizeof(MYPCSC_SCARD_IO_REQUEST) + sizeof(SERVER_SCARD_IO_REQUEST)); + dst->dwProtocol = swap32((uint32_t) src->dwProtocol); + dst->cbPciLength = swap32((uint32_t) src->cbPciLength + - sizeof(MYPCSC_SCARD_IO_REQUEST) + + sizeof(SERVER_SCARD_IO_REQUEST)); memcpy(dstBytes, srcBytes, bytesToCopy); } @@ -2480,8 +2481,7 @@ thread_function(PThreadListElement listElement) while (1) { while (listElement->data == NULL) - pthread_cond_wait(&listElement->nodata, - &listElement->busy); + pthread_cond_wait(&listElement->nodata, &listElement->busy); SC_deviceControl(listElement->data); listElement->data = NULL; @@ -2498,15 +2498,18 @@ SC_handleRequest(PSCThreadData data) int Result = 0; PThreadListElement cur; - for (cur = threadList; cur != NULL; cur = cur->next) { - if (cur->data == NULL) { + for (cur = threadList; cur != NULL; cur = cur->next) + { + if (cur->data == NULL) + { pthread_mutex_lock(&cur->busy); /* double check with lock held.... */ - if (cur->data != NULL) { + if (cur->data != NULL) + { pthread_mutex_unlock(&cur->busy); continue; } - + /* Wake up thread */ cur->data = data; pthread_cond_broadcast(&cur->nodata);