Changed some string terminations from NULL to \0.
[mmh] / uip / popsbr.c
index f86d5d3..6f2b35a 100644 (file)
@@ -7,6 +7,9 @@
 
 #include <h/mh.h>
 
+extern int  client(char *args, char *protocol, char *service, int rproto,
+                  char *response, int len_response);
+
 #if defined(NNTP) && !defined(PSHSBR)
 # undef NNTP
 #endif
@@ -86,7 +89,7 @@ pop_auth (char *user, char *pass)
        return NULL;
     }
 
-    *++lp = NULL;
+    *(++lp) = '\0';
     snprintf (buffer, sizeof(buffer), "%s%s", cp, pass);
 
     MD5Init (&mdContext);
@@ -107,7 +110,7 @@ pop_auth (char *user, char *pass)
        cp += 2;
        buflen -= 2;
     }
-    *cp = NULL;
+    *cp = '\0';
 
     return buffer;
 }
@@ -115,7 +118,7 @@ pop_auth (char *user, char *pass)
 
 
 int
-pop_init (char *host, char *user, char *pass, int snoop, int rpop)
+pop_init (char *host, char *user, char *pass, int snoop, int rpop, int kpop)
 {
     int fd1, fd2;
     char buffer[BUFSIZ];
@@ -128,16 +131,24 @@ pop_init (char *host, char *user, char *pass, int snoop, int rpop)
 #endif
 
 #ifndef NNTP
-# ifndef KPOP
-    if ((fd1 = client (host, "tcp", POPSERVICE, rpop, response, sizeof(response))) == NOTOK)
-# else /* KPOP */
-    snprintf (buffer, sizeof(buffer), "%s/%s", KPOP_PRINCIPAL, POPSERVICE);
-    if ((fd1 = client (host, "tcp", buffer, rpop, response, sizeof(response))) == NOTOK)
-# endif
+# ifdef KPOP
+    if ( kpop ) {
+       snprintf (buffer, sizeof(buffer), "%s/%s", KPOP_PRINCIPAL, "kpop");
+       if ((fd1 = client (host, "tcp", buffer, 0, response, sizeof(response))) == NOTOK) {
+           return NOTOK;
+       }
+    } else {
+# endif /* KPOP */
+      if ((fd1 = client (host, "tcp", POPSERVICE, rpop, response, sizeof(response))) == NOTOK) {
+           return NOTOK;
+      }
+# ifdef KPOP
+   }
+# endif /* KPOP */
 #else  /* NNTP */
     if ((fd1 = client (host, "tcp", "nntp", rpop, response, sizeof(response))) == NOTOK)
-#endif
        return NOTOK;
+#endif
 
     if ((fd2 = dup (fd1)) == NOTOK) {
        char *s;