summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/screen.c b/src/screen.c
index f26f036..ab8bf95 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -283,8 +283,13 @@ init_screen (rp_screen *s, int screen_num)
char *dot;
dot = strrchr(s->display_string, '.');
- if (dot && strlen (dot) < strlen (colon))
- sprintf(dot, ".%i", screen_num);
+ if (!dot || (strlen(dot) > strlen (colon)) )
+ {
+ /* no dot was found or it belongs to fqdn - append screen_num
+ to the end */
+ dot = s->display_string + strlen (s->display_string);
+ }
+ sprintf(dot, ".%i", screen_num);
}
PRINT_DEBUG (("display string: %s\n", s->display_string));