aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-04-24 15:49:57 -0400
committerB. Watson <urchlay@slackware.uk>2026-04-24 15:49:57 -0400
commita50e1e52fd7c62fda2d1804a3c7a860e47bf74a4 (patch)
tree48b574c2bd6c299b9e69b2ce6abbc08158b3295f
parent715964c0b5ab8a2bc2b8ae8b7935e9ea0088e332 (diff)
downloadfujinet-chat-a50e1e52fd7c62fda2d1804a3c7a860e47bf74a4.tar.gz
init_channels() has to call scr_create(), fixes the garbage issue.
-rw-r--r--src/main.c7
-rw-r--r--src/screen.c1
2 files changed, 5 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 1ed7240..5bf2db5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -82,10 +82,11 @@ void fn_disconnect(void) {
void init_channels(void) {
char i;
- for(i = 0; i < MAX_SCREENS - 2; i++) {
+ /* TODO: handle up to MAX_SCREENS when config.channels grows
+ past 5 elements. */
+ for(i = 0; /* i < MAX_SCREENS - 2 */ i < 6; i++) {
if(config.channels[i][0]) {
- screens[i + 2].status = SCR_INACTIVE;
- strcpy(screens[i + 2].title, config.channels[i]);
+ scr_create(config.channels[i]);
}
}
}
diff --git a/src/screen.c b/src/screen.c
index 5d64ee4..dd25938 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -65,6 +65,7 @@ char scr_create(const char *name) {
screens[i].pool = pool;
screens[i].line_list = (line_t *)END_MARKER;
screens[i].line_count = screens[i].scrollback_pos = 0;
+ scr_display(i);
return i;
}
}