]> git.cameronkatri.com Git - pw-darwin.git/blobdiff - chpass/util.c
Don't show on the screen just securely entered password
[pw-darwin.git] / chpass / util.c
index fe89d79b0b5d47e3ab64331acb1a575b21381385..605a48455fa0a6012c5cd8a87d1dc23ccf29ef42 100644 (file)
@@ -91,12 +91,16 @@ atot(p, store)
        }
        if (!(t = strtok(p, " \t")))
                goto bad;
-       for (mp = months;; ++mp) {
-               if (!*mp)
-                       goto bad;
-               if (!strncasecmp(*mp, t, 3)) {
-                       month = mp - months + 1;
-                       break;
+       if (isdigit(*t)) {
+               month = atoi(t);
+       } else {
+               for (mp = months;; ++mp) {
+                       if (!*mp)
+                               goto bad;
+                       if (!strncasecmp(*mp, t, 3)) {
+                               month = mp - months + 1;
+                               break;
+                       }
                }
        }
        if (!(t = strtok((char *)NULL, " \t,")) || !isdigit(*t))