diff options
author | Eduardo Chappa <chappa@washington.edu> | 2020-01-18 17:46:14 -0700 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2020-01-18 17:46:14 -0700 |
commit | 16b49fa63ad28aab44cde5096a706e6cc7520b1f (patch) | |
tree | 7ba6d75f6d8d2a3d52252d1732f52a39b670db92 /imap/src/osdep/unix/ssl_unix.c | |
parent | e328ab4a9dd90b53a4ae71cd97b699b1dd13e9a2 (diff) | |
download | alpine-16b49fa63ad28aab44cde5096a706e6cc7520b1f.tar.xz |
* Adding pith_ssl_encryption function to linkage.h.
Diffstat (limited to 'imap/src/osdep/unix/ssl_unix.c')
-rw-r--r-- | imap/src/osdep/unix/ssl_unix.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/imap/src/osdep/unix/ssl_unix.c b/imap/src/osdep/unix/ssl_unix.c index 020cfd77..93fb1a9a 100644 --- a/imap/src/osdep/unix/ssl_unix.c +++ b/imap/src/osdep/unix/ssl_unix.c @@ -636,20 +636,18 @@ char *ssl_getsize (SSLSTREAM *stream, unsigned long size) { char *ret = NIL; unsigned long got = 0L, need = size, n; - int done = 0; - while(!done){ + do { if(!ssl_getdata (stream)) return ret; /* return what we have */ n = stream->ictr < need ? stream->ictr : need; - fs_resize((void **) &ret, got + n + 1); + fs_resize((void **) &ret, (got + n + 1)*sizeof(char)); memcpy(ret + got, stream->iptr, n); ret[got+n] = '\0'; got += n; need -= n; stream->iptr += n; stream->ictr -= n; - if(need == 0L) done++; - } + } while (need > 0); return ret; } |