You have a hash that has a pointer to a const char as a key. If you have two character strings containing the same text (like "port" in your case) the pointers will be different, meaning that this returns false (check it out if you want):
Qt Code:
  1. const char *p1 = "port";
  2. const char *p2 = "port";
  3. if(p1==p2)
  4. printf("the same\n");
  5. else
  6. printf("different\n");
To copy to clipboard, switch view to plain text mode 

If you use C++ then avoid using char* for strings as they have no semantics. Use std::string or QString (if you use Qt - and you do) instead.