Browse Source

Add MIME part boundary generation function

master
Damien Goutte-Gattat 11 years ago
parent
commit
dc93af0770
  1. 16
      src/fmail.c

16
src/fmail.c

@ -74,6 +74,21 @@ See the COPYING file or <http://www.gnu.org/licenses/gpl.html>.\n\
/* Helper functions. */
static char *
generate_boundary(char *buffer, size_t len)
{
static const char chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/";
int i;
for ( i = 0; i < len - 1; i++ )
buffer[i] = chars[rand() % (sizeof(chars) - 1)];
buffer[i] = '\0';
return buffer;
}
static void
qp_encode_stream(FILE *in, FILE *out)
{
@ -214,6 +229,7 @@ main(int argc, char *argv[])
setprogname(argv[0]);
setlocale(LC_ALL, "");
srand(time(NULL));
headers = sb_new(0);
sign_ctx = NULL;

Loading…
Cancel
Save