]> diplodocus.org Git - nmh/blobdiff - uip/mhlogin.c
Replace getcpy() with mh_xstrdup() where the string isn't NULL.
[nmh] / uip / mhlogin.c
index aabe9a3d87cd7c87c8de5f304a631a6015208ae1..46a5a161d8e0b91e5d144f5ede136a5b63d025a1 100644 (file)
@@ -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();
     }