diff --git a/dgamelaunch.c b/dgamelaunch.c index c43e8a5..2732fb4 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -315,9 +315,13 @@ loadbanner (char *fname, struct dg_banner *ban) while (fgets (buf, 80, bannerfile) != NULL) { char bufnew[80]; + int slen; memset (bufnew, 0, 80); + slen = strlen(buf); + if ((slen > 0) && (buf[slen-1] == '\n')) buf[slen-1] = '\0'; + ban->len++; ban->lines = realloc (ban->lines, sizeof (char *) * ban->len); diff --git a/examples/dgamelaunch.conf b/examples/dgamelaunch.conf index dfc009a..dc2ca2e 100644 --- a/examples/dgamelaunch.conf +++ b/examples/dgamelaunch.conf @@ -133,7 +133,9 @@ menu["mainmenu_user"] { # the file must be inside the chroot. bannerfile = "dgl_menu_main_user.txt" # after which cursor is moved to this location - cursor = (5,18) +# if cursor-definition is missing, the cursor is put +# to the end of the last line of the banner. +# cursor = (5,18) # keys we accept. format is # commands["string_of_keys"] = # for example, you could use commands["qQ"] = quit