X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=src%2Fgridtest.c;h=4c59f1dda068aa9ac7cbb02ee62a3fc23b17e674;hb=3c678195610789166e1133575789f25da8f1a291;hp=682949d134f3a3394609511c2cf94b613ba87851;hpb=c8c67078daea54fdf03b46726a77ecf26cf65be4;p=rodin%2Fchimara.git diff --git a/src/gridtest.c b/src/gridtest.c index 682949d..4c59f1d 100644 --- a/src/gridtest.c +++ b/src/gridtest.c @@ -56,14 +56,16 @@ void glk_main(void) 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); @@ -73,4 +75,4 @@ void glk_main(void) glk_window_clear(mainwin); g_free(buffer); -} \ No newline at end of file +}