diff options
author | mjentsch <mtthsjntsch@gmail.com> | 2015-12-13 03:03:40 +0300 |
---|---|---|
committer | mjentsch <mtthsjntsch@gmail.com> | 2015-12-13 03:10:13 +0300 |
commit | de17ccb982bf5cab38ca1b15ccdc7071a29b5ce5 (patch) | |
tree | a73220e9036b23d2418e57d60e376b9b0a22a756 /tgp-blist.c | |
parent | f681aa21e29161f3a657f1ae93367a804ad94c4e (diff) |
Fix trailing whitespace on users without a last name
Diffstat (limited to 'tgp-blist.c')
-rw-r--r-- | tgp-blist.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tgp-blist.c b/tgp-blist.c index 62562e0..e09f658 100644 --- a/tgp-blist.c +++ b/tgp-blist.c @@ -146,6 +146,10 @@ char *tgp_blist_create_print_name (struct tgl_state *TLS, tgl_peer_id_t id, cons // libtgl passes 0 for all unused strings, therefore the last passed string will always be followed // by a NULL-termination as expected gchar *name = g_strjoin (" ", a1, a2, a3, a4, NULL); + + // When the user doesn't provide some input (like last name) ugly trailing or leading + // whitespaces may occur due to empty strings in the join operator + name = g_strstrip(name); /* Assure that all print_names are unique by checking the following conditions: 1. No other peer with that print_name should exists. If those names are not unique it will not be possible |