fprintf(stderr, "Now edit your previous line input\n");
glk_window_move_cursor(mainwin, 10, 22);
- glk_request_line_event(mainwin, buffer, 20, strlen(buffer));
+ glk_request_line_event(mainwin, buffer, 256, strlen(buffer));
while(1) {
glk_select(&ev);
if(ev.type == evtype_LineInput)
break;
}
- fprintf(stderr, "Your string was: '%s'.\nPress another key to clear the window and exit.\n", buffer);
+ gchar *text = g_strndup(buffer, ev.val1);
+ fprintf(stderr, "Your string was: '%s'.\nPress another key to clear the window and exit.\n", text);
+ g_free(text);
glk_request_char_event(mainwin);
while(1) {
glk_select(&ev);
glk_window_clear(mainwin);
g_free(buffer);
-}
\ No newline at end of file
+}