Fix iteration counter
diff --git a/library/debug.c b/library/debug.c
index 51b9307..8781869 100644
--- a/library/debug.c
+++ b/library/debug.c
@@ -243,7 +243,7 @@
         return;
     }
 
-    for( i = 0; i < sizeof( items ); i++ )
+    for( i = 0; i < POLARSSL_PK_DEBUG_MAX_ITEMS; i++ )
     {
         if( items[i].type == POLARSSL_PK_DEBUG_NONE )
             return;