imap-send: handle NULL return of next_arg()
commitf54c5bd40c0e215fc0ba196d74b092ef3ec02273
authorRené Scharfe <l.s.r@web.de>
Wed, 1 Nov 2017 17:03:20 +0000 (1 18:03 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 3 Nov 2017 13:45:45 +0000 (3 22:45 +0900)
treea869ff05fa594c7a72f9ffff3278a1ac4632579c
parent9752ad0bb79f680bca48db7adc45338b298304b0
imap-send: handle NULL return of next_arg()

next_arg() returns NULL if it runs out of arguments.  Most call sites
already handle that gracefully.  Check in the remaining cases as well.
Replace the NULL pointer with an empty string at the bottom of
get_cmd_result() -- it's nicely reported as an unexpected response a
few lines down.  Error out explicitly at the remaining sites.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
imap-send.c