regex[count] = '.';
count++;
} else if (string[i] == ',') {
+ if (i + 1 == len)
+ continue;
regex[count] = '|';
count++;
continue;
char *s1;
int ret = FALSE;
+ if (!string1 || !string2)
+ return ret;
+
s1 = silc_string_regexify(string1);
ret = silc_string_regex_match(s1, string2);
silc_free(s1);
struct passwd *pw;
pw = getpwuid(getuid());
- if (!pw) {
- fprintf(stderr, "silc_get_username: %s\n", strerror(errno));
- return NULL;
- }
-
+ if (!pw)
+ return strdup("foo");
+
logname = pw->pw_name;
}
}
return strdup(logname);
-}
+}
/* Returns the real name of ther user. */
struct passwd *pw;
pw = getpwuid(getuid());
- if (!pw) {
- fprintf(stderr, "silc_get_username: %s\n", strerror(errno));
- return NULL;
- }
+ if (!pw)
+ return strdup("Foo T. Bar");
if (strchr(pw->pw_gecos, ','))
*strchr(pw->pw_gecos, ',') = 0;