]> sjero.net Git - wget/commitdiff
[svn] Separate SSL error messages with "; ".
authorhniksic <devnull@localhost>
Mon, 4 Jul 2005 00:35:28 +0000 (17:35 -0700)
committerhniksic <devnull@localhost>
Mon, 4 Jul 2005 00:35:28 +0000 (17:35 -0700)
src/ChangeLog
src/openssl.c

index 984a34469ed4be6e7b220e18600126bb75ccbd32..dd5a6850538e8aab5c95425faae36b23a25e3392 100644 (file)
@@ -1,3 +1,7 @@
+2005-07-04  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * openssl.c (openssl_errstr): Separate error messages with "; ".
+
 2005-07-03  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * ftp.c (getftp): Ditto.
index 1f96706b0a5598c5974dc5828d62c6c19e442d21..f617f79b4eb51ecbedf18cb53d70c4fddf1bfbd9 100644 (file)
@@ -287,9 +287,8 @@ openssl_peek (int fd, char *buf, int bufsize, void *ctx)
 static const char *
 openssl_errstr (int fd, void *ctx)
 {
-  /* Unfortunately we cannot use ERR_error_string's internal buf
-     because we must be prepared to printing more than one error in
-     succession.  */
+  /* Unfortunately we cannot use ERR_error_string's internal buffer
+     because we must be prepared to print more than one error.  */
   static char errbuf[512];
   char *p = errbuf, *end = errbuf + sizeof errbuf;
   unsigned long err;
@@ -299,16 +298,18 @@ openssl_errstr (int fd, void *ctx)
     return NULL;
 
   /* Iterate over OpenSSL's error stack and print errors to ERRBUF,
-     each followed by '\n', while being careful not to overrun
-     ERRBUF.  */
+     separated by "; ", while being careful not to overrun ERRBUF.  */
   do
     {
       ERR_error_string_n (err, p, end - p);
       p = strchr (p, '\0');
-      if (p < end)
-       *p++ = '\n';
+      err = ERR_get_error ();
+      if (err == 0)
+       break;
+      if (p < end) *p++ = ';';
+      if (p < end) *p++ = ' ';
     }
-  while ((err = ERR_get_error ()) != 0);
+  while (p < end);
 
   if (p < end)
     *p++ = '\0';