]> git.cameronkatri.com Git - pw-darwin.git/blobdiff - pw/psdate.c
Partially revert r367756 (chpass(1) synopsis changes)
[pw-darwin.git] / pw / psdate.c
index bd2aa152b437522d96e8b7d6869bf7565ea385bb..8c833b5c69c72f8096888a5a300083d8bc9801f5 100644 (file)
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (C) 1996
  *     David L. Nugent.  All rights reserved.
  *
@@ -38,15 +40,11 @@ static const char rcsid[] =
 #include "psdate.h"
 
 
-static int
+int
 numerics(char const * str)
 {
-       int             rc = isdigit((unsigned char)*str);
 
-       if (rc)
-               while (isdigit((unsigned char)*str) || *str == 'x')
-                       ++str;
-       return rc && !*str;
+       return (str[strspn(str, "0123456789x")] == '\0');
 }
 
 static int