X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=user_list.c;h=c6d45ca5f4b2846f7f5a6350a8e84b3c551539a7;hb=2cc93ff31f16e65c1c1f94b0044b32f6be67cbd3;hp=b7d739c130fc08d5d69c159be3c46d927f894df2;hpb=505cfe0c6c8f9ef79d259ee64404ab40f2057081;p=paraslash.git diff --git a/user_list.c b/user_list.c index b7d739c1..c6d45ca5 100644 --- a/user_list.c +++ b/user_list.c @@ -122,19 +122,18 @@ void init_user_list(char *user_list_file) /** * lookup user in user_list. * - * \param user: must initially contain the name of the user and is filled - * in by this function on success. + * \param name of the user * - * \return 1 on success and < 0 on errors. + * \return a pointer to the corresponding user struct if the user was found, + * \p NULL otherwise. */ -int lookup_user(struct user *user) +struct user *lookup_user(const char *name) { struct user *u; list_for_each_entry(u, &user_list, node) { - if (strcmp(u->name, user->name)) + if (strcmp(u->name, name)) continue; - *user = *u; - return 1; + return u; } - return -E_BAD_USER; + return NULL; }