(imap_literal_string): Bugfix. Literal length may be {0}.
Showing
1 changed file
with
8 additions
and
0 deletions
... | @@ -970,6 +970,14 @@ imap_literal_string (f_imap_t f_imap, char **ptr) | ... | @@ -970,6 +970,14 @@ imap_literal_string (f_imap_t f_imap, char **ptr) |
970 | size_t len, len0, total; | 970 | size_t len, len0, total; |
971 | int status = 0; | 971 | int status = 0; |
972 | int nl; | 972 | int nl; |
973 | |||
974 | if (f_imap->string.nleft==0) | ||
975 | { | ||
976 | status = imap_readline (f_imap); | ||
977 | *ptr = f_imap->buffer; | ||
978 | return status; | ||
979 | } | ||
980 | |||
973 | /* The (len + 1) in the for is to count the strip '\r' by imap_readline. */ | 981 | /* The (len + 1) in the for is to count the strip '\r' by imap_readline. */ |
974 | for (len0 = len = total = 0; total < f_imap->string.nleft; total += (len + 1)) | 982 | for (len0 = len = total = 0; total < f_imap->string.nleft; total += (len + 1)) |
975 | { | 983 | { | ... | ... |
-
Please register or sign in to post a comment