X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fdemo_forms.c;h=f891b0407b85ed0067164af9c1c438aaf1317989;hp=7ba067c13a78d979c1ccb541d5930e899cfab502;hb=58552e8c761a70f8f0bd591fecdf576fa8216e3e;hpb=73b54c0812e4b8dfddcf87f59c7488bb3c10e10d;ds=inline diff --git a/test/demo_forms.c b/test/demo_forms.c index 7ba067c1..f891b040 100644 --- a/test/demo_forms.c +++ b/test/demo_forms.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2003-2013,2014 Free Software Foundation, Inc. * + * Copyright (c) 2003-2014,2016 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 * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: demo_forms.c,v 1.49 2014/08/02 23:11:57 tom Exp $ + * $Id: demo_forms.c,v 1.52 2016/09/10 21:14:55 tom Exp $ * * Demonstrate a variety of functions from the form library. * Thomas Dickey - 2003/4/26 @@ -149,8 +149,8 @@ read_data(const char *filename) char *value = typeRealloc(char, need, prior); if (value == 0) failed("realloc"); - strcat(value, "\n"); - strcat(value, buffer); + _nc_STRCAT(value, "\n", need); + _nc_STRCAT(value, buffer, need); my_data[more - 1].value = value; } else { more = 0; @@ -172,6 +172,7 @@ read_data(const char *filename) failed("expected a colon"); } } + fclose(fp); } else { failed(filename); } @@ -455,7 +456,8 @@ demo_forms(void) memset(f, 0, sizeof(f)); for (pg = 0; pg < 4; ++pg) { char label[80]; - sprintf(label, "Sample Form Page %d", pg + 1); + _nc_SPRINTF(label, _nc_SLIMIT(sizeof(label)) + "Sample Form Page %d", pg + 1); f[n++] = make_label(label, 0, 15); set_new_page(f[n - 1], TRUE);