[PATCH:xkbcomp 4/4] Initialize nMatch even if WIN32 is defined

Alan Coopersmith alan.coopersmith at oracle.com
Sat Mar 8 19:10:28 PST 2014


Flagged by cppcheck 1.64:
Checking app/xkbcomp/listing.c: WIN32...
[app/xkbcomp/listing.c:335]: (error) Uninitialized variable: nMatch

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 listing.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/listing.c b/listing.c
index c7f5ef8..945f7f6 100644
--- a/listing.c
+++ b/listing.c
@@ -292,8 +292,8 @@ AddDirectory(char *head, char *ptrn, char *rest, char *map)
 #else
     if ((dirp = opendir((head ? head : "."))) == NULL)
         return 0;
-    nMatch = 0;
 #endif
+    nMatch = 0;
 #ifdef WIN32
     do
 #else
-- 
1.7.9.2



More information about the xorg-devel mailing list