smdb.py: fix test for if a datatype is known
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 18 Jun 2014 07:39:26 +0000 (18 10:39 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 18 Jun 2014 07:39:26 +0000 (18 10:39 +0300)
The current test crashes instead of testing if a key exists.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_data/db/smdb.py

index b79e051..da1dfe2 100755 (executable)
@@ -64,7 +64,7 @@ db_types = {   0: "INTERNAL",
 def type_to_str(type_int):
 
     t = int(type_int)
-    if db_types[t]:
+    if db_types.has_key(t):
         return db_types[t]
     return type_int