mime encode
authorvb
Sun, 08 Feb 2015 13:27:08 -0500
changeset 51761bc0b46b98
parent 50 e713c3e6faf1
child 52 a667998cedf1
mime encode
src/mime.c
test/message_api_test.cc
     1.1 --- a/src/mime.c	Sun Feb 08 12:44:29 2015 -0500
     1.2 +++ b/src/mime.c	Sun Feb 08 13:27:08 2015 -0500
     1.3 @@ -75,7 +75,7 @@
     1.4      }
     1.5      // mailmime_add_part() takes ownership of mime
     1.6  
     1.7 -    char *template = strdup("/tmp/temp.XXXXXXXXXXXXXXXXXXXX");
     1.8 +    char *template = strdup("/tmp/pEp.XXXXXXXXXXXXXXXXXXXX");
     1.9      assert(template);
    1.10      if (template == NULL)
    1.11          goto enomem;
    1.12 @@ -130,7 +130,10 @@
    1.13  
    1.14      size = (size_t) len;
    1.15  
    1.16 +    errno = 0;
    1.17      rewind(file);
    1.18 +    assert(errno == 0);
    1.19 +    clearerr(file);
    1.20  
    1.21      buf = calloc(1, size + 1);
    1.22      assert(buf);
    1.23 @@ -143,7 +146,7 @@
    1.24          assert(feof(file) == 0);
    1.25          if (feof(file))
    1.26              goto err_file;
    1.27 -        bytes_read = fread(_buf, rest, 1, file);
    1.28 +        bytes_read = rest * fread(_buf, rest, 1, file);
    1.29          if (ferror(file))
    1.30              goto err_file;
    1.31      }
     2.1 --- a/test/message_api_test.cc	Sun Feb 08 12:44:29 2015 -0500
     2.2 +++ b/test/message_api_test.cc	Sun Feb 08 13:27:08 2015 -0500
     2.3 @@ -5,6 +5,8 @@
     2.4  using namespace std;
     2.5  
     2.6  int main() {
     2.7 +    cout << "*** message_api_test ***\n\n";
     2.8 +
     2.9      PEP_SESSION session;
    2.10      
    2.11      cout << "calling init()\n";