X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fdemo_terminfo.c;h=8e6ae1ca63fdd07e89eb992b45f12f1970efef4c;hp=b4466168fa6dc0710f354608bbd6fb0e0c8ae408;hb=21c8ffa0edf2e389f3f674f0c08009002c6f357d;hpb=d7e4a265b50f6fddbad20ea238fdc05a35cbdc2f diff --git a/test/demo_terminfo.c b/test/demo_terminfo.c index b4466168..8e6ae1ca 100644 --- a/test/demo_terminfo.c +++ b/test/demo_terminfo.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2009-2013,2014 Free Software Foundation, Inc. * + * Copyright (c) 2009-2014,2015 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey * - * $Id: demo_terminfo.c,v 1.37 2014/09/05 08:44:49 tom Exp $ + * $Id: demo_terminfo.c,v 1.39 2015/07/10 23:45:44 tom Exp $ * * A simple demo of the terminfo interface. */ @@ -266,6 +266,10 @@ abcdefghijklmnopqrstuvwxyz_"; if (!q_opt) printf("Terminal type \"%s\"\n", name); setupterm((NCURSES_CONST char *) name, 1, (int *) 0); + if (!q_opt) { + if (strcmp(name, ttytype)) + printf("... actual \"%s\"\n", ttytype); + } for (length = 1; length <= MAX_FORCE; ++length) { /* set all digits to zeros */ @@ -453,6 +457,7 @@ parse_description(const char *input_name) if ((fp = fopen(input_name, "r")) == 0) failed("cannot open input-file"); len = fread(my_blob, sizeof(char), (size_t) sb.st_size, fp); + my_blob[sb.st_size] = '\0'; fclose(fp); /*