diff options
author | Bardur Arantsson <bardur@scientician.net> | 2014-11-20 01:39:21 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2014-11-20 01:48:02 +0100 |
commit | c14efb95172fbd18a43f2f5b5714454a9ccb321e (patch) | |
tree | a3e7209ebcdedabea82b49abb1ad9d721bc815b9 /src/main.c | |
parent | bf70e894f195c5d408e3ee26acc2283236349235 (diff) |
Move user_name initialization to separate function
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -118,6 +118,16 @@ static void init_save_dir(void) } +static void init_player_name() +{ + /* Get the user id (?) */ + int player_uid = getuid(); + + /* Acquire the "user name" as a default player name */ + user_name(player_name, player_uid); +} + + /* * Simple "main" function for multiple platforms. @@ -138,19 +148,11 @@ int main(int argc, char *argv[]) bool_ args = TRUE; - int player_uid; - - - /* Get the file paths */ init_file_paths_with_env(); - - /* Get the user id (?) */ - player_uid = getuid(); - - /* Acquire the "user name" as a default player name */ - user_name(player_name, player_uid); + /* Initialize the player name */ + init_player_name(); /* Make sure save directory exists */ init_save_dir(); |