Displaying 3 results from an estimated 3 matches for "valid_char".
2016 Dec 24
0
[PATCH] lib: Use a common function to validate strings.
...bool alpha, bool digit, const char *extra)
+{
+ size_t i, len = strlen (str);
+
+ if ((min_length > 0 && len < min_length) ||
+ (max_length < SIZE_MAX && len > max_length))
+ return false;
+
+ for (i = 0; i < len; ++i) {
+ bool valid_char;
+
+ valid_char =
+ (alpha && c_isalpha (str[i])) ||
+ (digit && c_isdigit (str[i])) ||
+ (extra && strchr (extra, str[i]));
+
+ if (!valid_char) return false;
+ }
+
+ return true;
+}
+
#if 0 /* not used yet */
/**
* Hint that we will read or write...
2016 Dec 24
2
[PATCH] lib: Use a common function to validate strings.
As discussed in the thread on validating $TERM, it would be good to
have a common function to do this. This is such a function.
The main advantage is it includes unit tests which the previous
functions did not.
Rich.
2003 Jul 04
1
filenames with ":"
...ng SAMBA to connect to the windows machine. Gallery generates
filenames with a : in the name
Example : 1023493:239434.0. When you try to create a file with a : you get the following error:
$ touch 1:2
touch: 1:2: No such file or directory
I am currently running Samba 2.2.8.
I have tried both valid_chars and client_code_page in smb.conf and still no luck.