From: Simon Josefsson Date: Sun, 22 Aug 2004 12:52:45 +0000 (+0000) Subject: (smime_to_pkcs7): Handle LF EOF. X-Git-Tag: gnutls_1_1_18~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1bad57d6c331986d418aec0ebca87506243ce94d;p=thirdparty%2Fgnutls.git (smime_to_pkcs7): Handle LF EOF. --- diff --git a/src/certtool.c b/src/certtool.c index fb5b183b98..b6166cc5ce 100644 --- a/src/certtool.c +++ b/src/certtool.c @@ -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); }