X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=test%2Ftest_mouse.c;fp=test%2Ftest_mouse.c;h=d6013c7404b13393cd8305d6f88d260d3ceef071;hb=2632b47fdcf4dcd101962c92acafaac69630388f;hp=06c72e3760ddbf5cb9930e05c48ce2e2c4471c8f;hpb=79b9071f2be20a24c7be031655a5638f6032f29f;p=ncurses.git diff --git a/test/test_mouse.c b/test/test_mouse.c index 06c72e37..d6013c74 100644 --- a/test/test_mouse.c +++ b/test/test_mouse.c @@ -1,6 +1,6 @@ /**************************************************************************** + * Copyright 2022,2023 Thomas E. Dickey * * Copyright 2022 Leonid S. Usov * - * Copyright 2022 Thomas E. Dickey * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -22,7 +22,7 @@ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************/ /* - * $Id: test_mouse.c,v 1.26 2022/12/04 00:40:11 tom Exp $ + * $Id: test_mouse.c,v 1.27 2023/01/07 17:22:42 tom Exp $ * * Author: Leonid S Usov * @@ -165,8 +165,10 @@ main(int argc, char *argv[]) break; case 'T': my_environ = malloc(strlen(term_format) + strlen(optarg)); - sprintf(my_environ, term_format, optarg); - putenv(my_environ); + if (my_environ != NULL) { + sprintf(my_environ, term_format, optarg); + putenv(my_environ); + } break; case OPTS_VERSION: show_version(argv);