diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-12-02 18:49:48 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-12-04 12:10:09 +0100 |
commit | 49676b96484523543f53a19f9da1a9cb6a825b46 (patch) | |
tree | 82c370ad7800259f5ae7d98a89f5454c11bf8b6b | |
parent | f5378b3cd99c51b124bcbd3f50ffcaef8aad5fdd (diff) | |
download | cmumble-49676b96484523543f53a19f9da1a9cb6a825b46.tar.gz cmumble-49676b96484523543f53a19f9da1a9cb6a825b46.tar.bz2 cmumble-49676b96484523543f53a19f9da1a9cb6a825b46.zip |
cmumble: Default to unix username as username
-rw-r--r-- | src/cmumble.c | 8 | ||||
-rw-r--r-- | src/cmumble.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/cmumble.c b/src/cmumble.c index 2613ea8..ca8830f 100644 --- a/src/cmumble.c +++ b/src/cmumble.c @@ -296,7 +296,7 @@ cmumble_protocol_init(struct cmumble *cm) cmumble_send_version(cm, &version); cmumble_init_authenticate(&authenticate); - authenticate.username = cm->user_name; + authenticate.username = (char *) cm->user_name; authenticate.password = ""; authenticate.n_celt_versions = 1; authenticate.celt_versions = &cm->audio.celt_bitstream_version; @@ -308,8 +308,8 @@ cmumble_protocol_init(struct cmumble *cm) g_source_unref(source); } -gchar *user = "unkown"; -gchar *host = "localhost"; +const gchar *user = NULL; +const gchar *host = "localhost"; gint port = 64738; gboolean verbose = FALSE; @@ -350,7 +350,7 @@ int main(int argc, char **argv) memset(&cm, 0, sizeof(cm)); - cm.user_name = user; + cm.user_name = user ? user : g_get_user_name(); cm.users = NULL; cm.verbose = verbose; diff --git a/src/cmumble.h b/src/cmumble.h index 2dac580..7e83a73 100644 --- a/src/cmumble.h +++ b/src/cmumble.h @@ -27,7 +27,7 @@ struct cmumble { uint32_t session; gboolean authenticated; - char *user_name; + const char *user_name; int64_t sequence; |