Replace calls to fprintf with new tr_* macros
[trust_router.git] / common / tr_rp.c
index c879aca..7244cbd 100644 (file)
 #include <tr_rp.h>
 #include <tr_config.h>
 #include <tr.h>
+#include <tr_debug.h>
 
 TR_RP_CLIENT *tr_rp_client_lookup(TR_INSTANCE *tr, TR_NAME *gss_name) {
   TR_RP_CLIENT *rp = NULL;
   int i = 0;
 
   if ((!tr) || (!tr->active_cfg) || (!gss_name)) {
-    fprintf(stderr, "tr_rp_client_lookup: Bad parameters.\n");
+    tr_debug("tr_rp_client_lookup: Bad parameters.");
     return NULL;
   }
 
   for (rp = tr->active_cfg->rp_clients; NULL != rp; rp = rp->next) {
-    for (i = 0; i < TR_MAX_GSS_NAMES; i++) {
-      if (!strcmp(gss_name->buf, rp->gss_names[i]->buf)) {
+    for (i = 0; ((i < TR_MAX_GSS_NAMES) && (NULL != (rp->gss_names[i]))); i++) {
+       if (!tr_name_cmp(gss_name, rp->gss_names[i])) {
        return rp;
       }
     }