- 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);