/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (C) 1996
* David L. Nugent. All rights reserved.
*
"$FreeBSD$";
#endif /* not lint */
-#include <stdio.h>
+#include <ctype.h>
+#include <err.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <xlocale.h>
-#include <err.h>
#include "psdate.h"
static 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