X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=src%2Fgridtest.c;h=4c59f1dda068aa9ac7cbb02ee62a3fc23b17e674;hb=3c678195610789166e1133575789f25da8f1a291;hp=92d3d0cddafd1402aeef9f316371665258da4cd3;hpb=e7b655fa76e4a42b1a0228bd7e9290998a1fbeae;p=rodin%2Fchimara.git diff --git a/src/gridtest.c b/src/gridtest.c index 92d3d0c..4c59f1d 100644 --- a/src/gridtest.c +++ b/src/gridtest.c @@ -63,7 +63,9 @@ void glk_main(void) 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 +}