]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
(smime_to_pkcs7): Handle LF EOF.
authorSimon Josefsson <simon@josefsson.org>
Sun, 22 Aug 2004 12:52:45 +0000 (12:52 +0000)
committerSimon Josefsson <simon@josefsson.org>
Sun, 22 Aug 2004 12:52:45 +0000 (12:52 +0000)
src/certtool.c

index fb5b183b983d2e8f78449469fb42313dd202139d..b6166cc5cefe9fdb565447654594494cab08ca06 100644 (file)
@@ -2689,7 +2689,7 @@ void smime_to_pkcs7(void)
       if (len == -1)
        error (EXIT_FAILURE, 0, "Cannot find RFC 2822 header/body separator");
     }
-  while (strcmp (lineptr, "\r\n") != 0);
+  while (strcmp (lineptr, "\r\n") != 0 && strcmp (lineptr, "\n") != 0);
 
   do
     {
@@ -2697,13 +2697,13 @@ void smime_to_pkcs7(void)
       if (len == -1)
        error (EXIT_FAILURE, 0, "Message has RFC 2822 header but no body");
     }
-  while (strcmp (lineptr, "\r\n") == 0);
+  while (strcmp (lineptr, "\r\n") == 0 && strcmp (lineptr, "\n") == 0);
 
   printf ("-----BEGIN PKCS7-----\n");
 
   do
     {
-      if (strcmp (lineptr, "\r\n") != 0)
+      if (strcmp (lineptr, "\r\n") != 0 && strcmp (lineptr, "\n") != 0)
        printf("%s", lineptr);
       len = getline (&lineptr, &linesize, infile);
     }