Nico Golde:
[apps/madmutt.git] / imap / auth_gss.c
index a6a2908..e687fbd 100644 (file)
@@ -18,8 +18,9 @@
 
 /* GSS login/authentication code */
 
-/* for HAVE_HEIMDAL */
-#include "config.h"
+#if HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include "mutt.h"
 #include "imap_private.h"
@@ -122,7 +123,7 @@ imap_auth_res_t imap_auth_gss (IMAP_DATA* idata, const char* method)
   mutt_to_base64 ((unsigned char*) buf1, send_token.value, send_token.length,
     sizeof (buf1) - 2);
   gss_release_buffer (&min_stat, &send_token);
-  strncat (buf1, "\r\n", sizeof (buf1));
+  safe_strcat (buf1, sizeof (buf1), "\r\n");
   mutt_socket_write (idata->conn, buf1);
 
   while (maj_stat == GSS_S_CONTINUE_NEEDED)
@@ -158,7 +159,7 @@ imap_auth_res_t imap_auth_gss (IMAP_DATA* idata, const char* method)
     mutt_to_base64 ((unsigned char*) buf1, send_token.value,
       send_token.length, sizeof (buf1) - 2);
     gss_release_buffer (&min_stat, &send_token);
-    strncat (buf1, "\r\n", sizeof (buf1));
+    safe_strcat (buf1, sizeof (buf1), "\r\n");
     mutt_socket_write (idata->conn, buf1);
   }
 
@@ -226,7 +227,7 @@ imap_auth_res_t imap_auth_gss (IMAP_DATA* idata, const char* method)
                  sizeof (buf1) - 2);
   dprint (2, (debugfile, "Requesting authorisation as %s\n",
     idata->conn->account.user));
-  strncat (buf1, "\r\n", sizeof (buf1));
+  safe_strcat (buf1, sizeof (buf1), "\r\n");
   mutt_socket_write (idata->conn, buf1);
 
   /* Joy of victory or agony of defeat? */