We want to use the C locale.
Reported-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
#include "atoi/a2i.h"
#include "defines.h"
#include "prototypes.h"
+#include "string/ctype/isascii.h"
#include "string/strcmp/streq.h"
if (streq(end, ""))
return 0; /* <long>- */
parse_max:
- if (!isdigit((unsigned char) *end))
+ if (!isdigit_c(*end))
return -1;
if (a2ul(max, end, NULL, 10, *min, ULONG_MAX) == -1)
#include "io/fgets/fgets.h"
#include "port.h"
#include "prototypes.h"
+#include "string/ctype/isascii.h"
#include "string/strcmp/streq.h"
#include "string/strcmp/strprefix.h"
#include "string/strtok/stpsep.h"
* week or the other two values.
*/
- for (i = 0; isalpha(cp[i]) && ('\0' != cp[i + 1]); i += 2) {
+ for (i = 0; isalpha_c(cp[i]) && ('\0' != cp[i + 1]); i += 2) {
switch ((cp[i] << 8) | (cp[i + 1])) {
case ('S' << 8) | 'u':
port.pt_times[j].t_days |= 01;
* representing the times of day.
*/
- for (dtime = 0; isdigit (cp[i]); i++) {
+ for (dtime = 0; isdigit_c(cp[i]); i++) {
dtime = dtime * 10 + cp[i] - '0';
}
port.pt_times[j].t_start = dtime;
cp = cp + i + 1;
- for (dtime = 0, i = 0; isdigit (cp[i]); i++) {
+ for (dtime = 0, i = 0; isdigit_c(cp[i]); i++) {
dtime = dtime * 10 + cp[i] - '0';
}
#include "config.h"
-#include <ctype.h>
#include <stdbool.h>
+#include "string/ctype/isascii.h"
#include "string/strcmp/streq.h"
inline bool strchriscntrl(const char *s);
-// string character is [:cntrl:]
-// Return true if any iscntrl(3) character is found in the string.
+// strchriscntrl - string character is [:cntrl:]
inline bool
strchriscntrl(const char *s)
{
for (; !streq(s, ""); s++) {
unsigned char c = *s;
- if (iscntrl(c))
+ if (iscntrl_c(c))
return true;
}
#include <stdbool.h>
+#include "string/ctype/isascii.h"
#include "string/strcmp/streq.h"
#include "string/strspn/stpspn.h"
inline bool strisdigit(const char *s);
-// string is [:digit:]
-// Like isdigit(3), but check all characters in the string.
+// strisdigit - string is [:digit:]
inline bool
strisdigit(const char *s)
{
if (streq(s, ""))
return false;
- return streq(stpspn(s, "0123456789"), "");
+ return streq(stpspn(s, CTYPE_DIGIT_C), "");
}
#include "config.h"
-#include <ctype.h>
#include <stdbool.h>
+#include "string/ctype/isascii.h"
#include "string/strcmp/streq.h"
inline bool strisprint(const char *s);
-// string is [:print:]
-// Like isprint(3), but check all characters in the string.
+// strisprint - string is [:print:]
inline bool
strisprint(const char *s)
{
return false;
for (; !streq(s, ""); s++) {
- unsigned char c = *s;
-
- if (!isprint(c))
+ if (!isprint_c(*s))
return false;
}
#include "shadow/gshadow/sgrp.h"
#include "shadowlog.h"
#include "sssd.h"
+#include "string/ctype/isascii.h"
#include "string/sprintf/stprintf.h"
#include "string/strcmp/streq.h"
#include "string/strdup/strdup.h"
return 0;
}
- if (isdigit (gid[0])) {
+ if (isdigit_c(gid[0])) {
/*
* The GID is a number, which means either this is a brand
* new group, or an existing group.
/*
* Now I have all of the fields required to create the new group.
*/
- if (!streq(gid, "") && (!isdigit(gid[0]))) {
+ if (!streq(gid, "") && (!isdigit_c(gid[0]))) {
grent.gr_name = xstrdup (gid);
} else {
grent.gr_name = xstrdup (name);
* The first guess for the UID is either the numerical UID that the
* caller provided, or the next available UID.
*/
- if (isdigit (uid[0])) {
+ if (isdigit_c(uid[0])) {
if ((get_uid(uid, nuid) == -1) || (*nuid == (uid_t)-1)) {
fprintf (stderr,
_("%s: invalid user ID '%s'\n"),