[Pcsclite-cvs-commit] r5441 - /trunk/PCSC/src/simclist.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Sun Dec 12 09:14:44 UTC 2010


Author: rousseau
Date: Sun Dec 12 09:14:34 2010
New Revision: 5441

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5441
Log:
Reapply change in revision 4986 since the problem was not corrected in
version 1.5 of simclist.

Modified:
    trunk/PCSC/src/simclist.c

Modified: trunk/PCSC/src/simclist.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/simclist.c?rev=5441&op=diff
==============================================================================
--- trunk/PCSC/src/simclist.c (original)
+++ trunk/PCSC/src/simclist.c Sun Dec 12 09:14:34 2010
@@ -411,7 +411,11 @@
     /* accept 1 slot overflow for fetching head and tail sentinels */
     if (posstart < -1 || posstart > (int)l->numels) return NULL;
 
-    x = (float)(posstart+1) / l->numels;
+
+    if (0 == l->numels)
+        x = 0;
+    else
+        x = (float)(posstart+1) / l->numels;
     if (x <= 0.25) {
         /* first quarter: get to posstart from head */
         for (i = -1, ptr = l->head_sentinel; i < posstart; ptr = ptr->next, i++);




More information about the Pcsclite-cvs-commit mailing list