aboutsummaryrefslogtreecommitdiff
path: root/tsalis/src
diff options
context:
space:
mode:
Diffstat (limited to 'tsalis/src')
-rw-r--r--tsalis/src/handler.c1
-rw-r--r--tsalis/src/printer.c11
-rw-r--r--tsalis/src/tsalis.c8
3 files changed, 15 insertions, 5 deletions
diff --git a/tsalis/src/handler.c b/tsalis/src/handler.c
index 21aa706..ded2d9a 100644
--- a/tsalis/src/handler.c
+++ b/tsalis/src/handler.c
@@ -130,6 +130,7 @@ static void
renameSim(const char *name)
{
if (strlen(name) <= NAME_MAX_SIZE) {
+ clear();
strncpy(g_simName, name, NAME_MAX_SIZE);
}
}
diff --git a/tsalis/src/printer.c b/tsalis/src/printer.c
index a3f60b6..469b803 100644
--- a/tsalis/src/printer.c
+++ b/tsalis/src/printer.c
@@ -1,4 +1,5 @@
#include <stdarg.h>
+#include <string.h>
#include <curses.h>
#include <salis.h>
#include "printer.h"
@@ -714,7 +715,15 @@ tsp_printData(void)
int linev = 1;
int *line = &linev;
PHEADER("SALIS");
- PSIDGET("name", g_simName);
+
+ if (strlen(g_simName) < 24) {
+ PHEADER(g_simName);
+ } else {
+ attron(COLOR_PAIR(PAIR_HEADER));
+ printWidget((*line)++, "%.20s...", g_simName);
+ standend();
+ }
+
PSIDGET("state", g_running ? "running" : "paused");
if (g_autoSaveInterval) {
diff --git a/tsalis/src/tsalis.c b/tsalis/src/tsalis.c
index ab24c61..81c9a3d 100644
--- a/tsalis/src/tsalis.c
+++ b/tsalis/src/tsalis.c
@@ -33,7 +33,7 @@ onLoad(const char *fileName)
FILE *testFile;
if (strlen(fileName) > NAME_MAX_SIZE) {
- fputs("ERROR: File name too long", stderr);
+ fputs("ERROR: File name too long\n", stderr);
exit(1);
}
@@ -44,7 +44,7 @@ onLoad(const char *fileName)
fclose(testFile);
s_load(g_simName);
} else {
- fputs("ERROR: File does not exist", stderr);
+ fputs("ERROR: File does not exist\n", stderr);
exit(1);
}
}
@@ -63,11 +63,11 @@ init(int argc, char **argv)
} else if (cmd == 'l') {
onLoad(val);
} else {
- fputs("ERROR: Incorrect arguments", stderr);
+ fputs("ERROR: Incorrect arguments\n", stderr);
exit(1);
}
} else {
- fputs("ERROR: Incorrect argument count", stderr);
+ fputs("ERROR: Incorrect argument count\n", stderr);
exit(1);
}