From: Simon Josefsson Date: Sun, 22 Aug 2004 13:15:06 +0000 (+0000) Subject: (smime_to_pkcs7): Make sure PKCS#7 output use LF EOL. X-Git-Tag: gnutls_1_1_18~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb6452d91a2cd6bf99ae61ae981142bdf9762391;p=thirdparty%2Fgnutls.git (smime_to_pkcs7): Make sure PKCS#7 output use LF EOL. --- diff --git a/src/certtool.c b/src/certtool.c index b6166cc5ce..8d312af799 100644 --- a/src/certtool.c +++ b/src/certtool.c @@ -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);