summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2014-11-20 01:39:21 +0100
committerBardur Arantsson <bardur@scientician.net>2014-11-20 01:48:02 +0100
commitc14efb95172fbd18a43f2f5b5714454a9ccb321e (patch)
treea3e7209ebcdedabea82b49abb1ad9d721bc815b9
parentbf70e894f195c5d408e3ee26acc2283236349235 (diff)
Move user_name initialization to separate function
-rw-r--r--src/main.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/main.c b/src/main.c
index b59e11ac..fae511d7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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();