Browse Source

HPCC-18855 Addresses invalid string compare

- Compares token type instead of actual string

Signed-off-by: Rodrigo Pastrana <rodrigo.pastrana@lexisnexis.com>
Rodrigo Pastrana 7 years ago
parent
commit
66d40f709f
1 changed files with 15 additions and 15 deletions
  1. 15 15
      esp/services/ws_sql/ws_sqlService.cpp

+ 15 - 15
esp/services/ws_sql/ws_sqlService.cpp

@@ -333,21 +333,21 @@ void  printTree(pANTLR3_BASE_TREE t, int indent)
 
     if ( t != NULL )
     {
-    children = t->getChildCount(t);
-    for ( i = 0; i < indent; i++ )
-      ind += "   ";
-
-    for ( i = 0; i < children; i++ )
-      {
-        pANTLR3_BASE_TREE child = (pANTLR3_BASE_TREE)(t->getChild(t, i));
-        ANTLR3_UINT32 tokenType = child->getType(child);
-
-        tokenText = (char *)child->toString(child)->chars;
-        fprintf(stderr, "%s%s\n", ind.c_str(), tokenText);
-        if (tokenText == "<EOF>")
-          break;
-        printTree(child, indent+1);
-      }
+        children = t->getChildCount(t);
+        for ( i = 0; i < indent; i++ )
+          ind += "   ";
+
+        for ( i = 0; i < children; i++ )
+        {
+            pANTLR3_BASE_TREE child = (pANTLR3_BASE_TREE)(t->getChild(t, i));
+            ANTLR3_UINT32 tokenType = child->getType(child);
+
+            tokenText = (char *)child->toString(child)->chars;
+            fprintf(stderr, "%s%s\n", ind.c_str(), tokenText);
+            if (tokenType == ANTLR3_TOKEN_EOF)
+                break;
+            printTree(child, indent+1);
+        }
     }
 }