- while ((cred = mh_oauth_authorize(code, ctx)) == NULL
- && mh_oauth_get_err_code(ctx) == MH_OAUTH_BAD_GRANT) {
- printf("Code rejected; try again? ");
+ while (!*code ||
+ ((cred = mh_oauth_authorize(code, ctx)) == NULL
+ && mh_oauth_get_err_code(ctx) == MH_OAUTH_BAD_GRANT)) {
+ printf(!*code ? "Empty code; try again? " : "Code rejected; try again? ");