X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/23f2b007ecac94848616420b27f0819ea559507e..8374c3c:/uip/mhlogin.c?ds=inline diff --git a/uip/mhlogin.c b/uip/mhlogin.c index 6ce414f2..46a5a161 100644 --- a/uip/mhlogin.c +++ b/uip/mhlogin.c @@ -71,7 +71,7 @@ do_login(const char *svc, const char *user, const char *browser, int snoop) mh_oauth_log_to(stderr, ctx); } - fn = getcpy(mh_oauth_cred_fn(ctx)); + fn = getcpy(mh_oauth_cred_fn(svc)); if ((url = mh_oauth_get_authorize_url(ctx)) == NULL) { adios(NULL, mh_oauth_get_err_string(ctx)); @@ -101,10 +101,10 @@ do_login(const char *svc, const char *user, const char *browser, int snoop) fflush(stdout); code = geta(); - while (strlen(code) == 0 || + while (!*code || ((cred = mh_oauth_authorize(code, ctx)) == NULL && mh_oauth_get_err_code(ctx) == MH_OAUTH_BAD_GRANT)) { - printf(strlen(code) == 0 ? "Empty code; try again? " : "Code rejected; try again? "); + printf(!*code ? "Empty code; try again? " : "Code rejected; try again? "); fflush(stdout); code = geta(); }