X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/177f020f122827214159c46dcfe7ded1e3c8d1c3..8699f1cc0c8db8d3b0d6e7d607f3e92b214ec80f:/uip/mhlogin.c diff --git a/uip/mhlogin.c b/uip/mhlogin.c index 32183863..e02ef465 100644 --- a/uip/mhlogin.c +++ b/uip/mhlogin.c @@ -10,8 +10,10 @@ #include #include +#include "h/done.h" #include #include +#include "sbr/lock_file.h" #define MHLOGIN_SWITCHES \ X("user username", 0, USERSW) \ @@ -63,17 +65,17 @@ do_login(const char *svc, const char *user, const char *browser, int snoop) } if (!mh_oauth_new(&ctx, svc)) { - adios(NULL, mh_oauth_get_err_string(ctx)); + adios(NULL, "%s", mh_oauth_get_err_string(ctx)); } if (snoop) { mh_oauth_log_to(stderr, ctx); } - fn = mh_xstrdup(mh_oauth_cred_fn(svc)); + fn = mh_oauth_cred_fn(svc); if ((url = mh_oauth_get_authorize_url(ctx)) == NULL) { - adios(NULL, mh_oauth_get_err_string(ctx)); + adios(NULL, "%s", mh_oauth_get_err_string(ctx)); } if (browser) { @@ -109,7 +111,7 @@ do_login(const char *svc, const char *user, const char *browser, int snoop) } if (cred == NULL) { inform("error exchanging code for OAuth2 token"); - adios(NULL, mh_oauth_get_err_string(ctx)); + adios(NULL, "%s", mh_oauth_get_err_string(ctx)); } cred_file = lkfopendata(fn, "r+", &failed_to_lock); @@ -120,7 +122,7 @@ do_login(const char *svc, const char *user, const char *browser, int snoop) adios(fn, "oops"); } if (!mh_oauth_cred_save(cred_file, cred, user)) { - adios(NULL, mh_oauth_get_err_string(ctx)); + adios(NULL, "%s", mh_oauth_get_err_string(ctx)); } if (lkfclosedata(cred_file, fn) != 0) { adios (fn, "oops");