]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
(smime_to_pkcs7): Make sure PKCS#7 output use LF EOL.
authorSimon Josefsson <simon@josefsson.org>
Sun, 22 Aug 2004 13:15:06 +0000 (13:15 +0000)
committerSimon Josefsson <simon@josefsson.org>
Sun, 22 Aug 2004 13:15:06 +0000 (13:15 +0000)
src/certtool.c

index b6166cc5cefe9fdb565447654594494cab08ca06..8d312af799b1fd12ec1c440c7353c63865a6df79 100644 (file)
@@ -2703,8 +2703,10 @@ void smime_to_pkcs7(void)
 
   do
     {
-      if (strcmp (lineptr, "\r\n") != 0 && strcmp (lineptr, "\n") != 0)
-       printf("%s", lineptr);
+      while (len > 0 && (lineptr[len-1] == '\r' || lineptr[len-1] == '\n'))
+       lineptr[--len] = '\0';
+      if (strcmp (lineptr, "") != 0)
+       printf("%s\n", lineptr);
       len = getline (&lineptr, &linesize, infile);
     }
   while (len != -1);