diff options
author | Eduardo Chappa <chappa@washington.edu> | 2020-01-18 02:21:13 -0700 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2020-01-18 02:21:13 -0700 |
commit | 29c656f7929ef43462c7f737a363ceecc16e3f11 (patch) | |
tree | 6cd52132147c210768b14e5e88053432585b8f05 /imap/src/osdep/nt | |
parent | b381cc1f2238d6d7d8de4b63200c9c15900a21dc (diff) | |
download | alpine-29c656f7929ef43462c7f737a363ceecc16e3f11.tar.xz |
* Various fixes to copyright notices, make sure we allocate enough
memory in file http.c, and move Pico version to 5.10.
Diffstat (limited to 'imap/src/osdep/nt')
-rw-r--r-- | imap/src/osdep/nt/ssl_win.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/imap/src/osdep/nt/ssl_win.c b/imap/src/osdep/nt/ssl_win.c index 783c080a..0e77ee3c 100644 --- a/imap/src/osdep/nt/ssl_win.c +++ b/imap/src/osdep/nt/ssl_win.c @@ -497,24 +497,22 @@ static char *ssl_getline_work (SSLSTREAM *stream,unsigned long *size, return ret; } -char* ssl_getsize(SSLSTREAM* stream, unsigned long size) +char *ssl_getsize(SSLSTREAM* stream, unsigned long size) { - char* ret = NIL; + 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; } |