summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index fca7328..e1ae22a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -325,7 +325,7 @@ int speak_finalize(char *ssml, char *v2j_profile, char **links, char **out_link)
if (*out_link == NULL) pid_waitwake = v2j_waitwake(v2j_profile);
}
free(line);
- } else {
+ } else if (ch > 0) {
// Read in a line
tcsetattr(0, TCSANOW, &stored_settings);
char buffer[512];
@@ -334,9 +334,9 @@ int speak_finalize(char *ssml, char *v2j_profile, char **links, char **out_link)
putchar(ch);
char *line = buffer + 1;
- size_t len = 512;
+ size_t len = 510;
if (getline(&line, &len, stdin) < 0)
- fprintf(stderr, "Failed to read stdin line!\n");
+ perror("Failed to read stdin line");
else if (out_link != NULL)
*out_link = select_link(links, buffer);
tcsetattr(0, TCSANOW, &no_echo);