printf("Error: read() from stdin returns 0.\n");
} else if (n < 0) {
printf("input: read, err\n");
- } else if (n < 1024) {
+ } else if (n - 1 > 0 && n < 1024) {
buf[n - 1] = '\0'; /* remove new line... */
printf("\n\n");
__process_input(buf, user_data);
printf("Error: read() from stdin returns 0.\n");
} else if (n < 0) {
printf("input: read, err\n");
- } else if (n < 1024) {
+ } else if (n - 1 > 0 && n < 1024) {
buf[n - 1] = '\0'; /* remove new line... */
printf("\n\n");
__process_input(buf, user_data);
printf("Error: read() from stdin returns 0.\n");
} else if (n < 0) {
printf("input: read, err\n");
- } else if (n < 1024) {
+ } else if (n - 1 > 0 && n < 1024) {
buf[n - 1] = '\0'; /* remove new line... */
printf("\n\n");
__process_input(buf, user_data);