Displaying 3 results from an estimated 3 matches for "find_home_for_usernam".
Did you mean:
find_home_for_username
2009 Aug 21
9
enable -Werror and all of gcc's warning options
Here is a bunch of small patches to make fish/ build
with most warnings enabled:
[1/9] edit.c: avoid warning about signed/unsigned comparison
[2/9] fish.c: avoid warnings
[3/9] tilde.c: avoid a warning
[4/9] fish.c: avoid "assignment discards qualifiers..." warning
[5/9] fish.c: avoid signed/unsigned-comparison warning
[6/9] fish.c: don't perform arithmetic on void*
2009 Nov 09
1
use STREQ(a,b), not strcmp(a,b) == 0
...ontent_new, size) == 0) {
+ if (strlen (content) == size && STREQLEN (content, content_new, size)) {
free (content);
free (content_new);
return 0;
diff --git a/fish/tilde.c b/fish/tilde.c
index 1c52d3e..64b5b39 100644
--- a/fish/tilde.c
+++ b/fish/tilde.c
@@ -110,7 +110,7 @@ find_home_for_username (const char *username, size_t ulen)
setpwent ();
while ((pw = getpwent ()) != NULL) {
if (strlen (pw->pw_name) == ulen &&
- strncmp (username, pw->pw_name, ulen) == 0)
+ STREQLEN (username, pw->pw_name, ulen))
return pw->pw_dir;
}
diff --git...
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...pansion (char *str)
len = strlen (home) + strlen (rest);
str = malloc (len);
if (str == NULL) {
- perror ("malloc");
- exit (1);
+ perror ("malloc");
+ exit (1);
}
strcpy (str, home);
strcat (str, rest);
@@ -113,7 +113,7 @@ find_home_for_username (const char *username, int ulen)
setpwent ();
while ((pw = getpwent ()) != NULL) {
if (strlen (pw->pw_name) == ulen &&
- strncmp (username, pw->pw_name, ulen) == 0)
+ strncmp (username, pw->pw_name, ulen) == 0)
return pw->pw_dir;
}
diff --git a/fish...