AmendHub

Download:

jcs

/

subtext

/

amendments

/

231

user: Rename user_find_username to user_username

This function isn't looking up something from bile that needs to be
freed, it's just checking its cache.

jcs made amendment 231 over 2 years ago
--- user.c Sun Jul 31 17:58:55 2022 +++ user.c Mon Aug 1 09:59:16 2022 @@ -136,7 +136,7 @@ user_find_by_username(const char *username) } struct username_cache * -user_find_username(unsigned long id) +user_username(unsigned long id) { struct username_cache *muser; size_t n; @@ -298,7 +298,7 @@ user_first_sysop_username(void) sizeof(user)); xfree(&o); if (user.is_sysop) { - ret = xstrdup(user.username); + ret = xstrdup(user.username, "user_first_sysop_username"); break; } nuser++; --- user.h Thu Jun 30 10:26:12 2022 +++ user.h Mon Aug 1 09:59:33 2022 @@ -46,7 +46,7 @@ void user_cache_usernames(void); void user_save(struct user *user); struct user * user_find(unsigned long id); struct user * user_find_by_username(const char *username); -struct username_cache * user_find_username(unsigned long id); +struct username_cache * user_username(unsigned long id); short user_authenticate(struct user *user, const char *password); void user_set_password(struct user *user, const char *password); bool user_valid_username(struct user *user, char *username, char **error);