]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/test_mouse.c
ncurses 6.4 - patch 20230603
[ncurses.git] / test / test_mouse.c
index 06c72e3760ddbf5cb9930e05c48ce2e2c4471c8f..9179105002e1f69e8f93c75effc29901494c571d 100644 (file)
@@ -1,6 +1,6 @@
 /****************************************************************************
+ * Copyright 2022,2023 Thomas E. Dickey                                     *
  * Copyright 2022 Leonid S. Usov <leonid.s.usov at gmail.com>               *
- * 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.28 2023/04/16 17:36:47 tom Exp $
  *
  * Author: Leonid S Usov
  *
@@ -63,7 +63,7 @@ raw_loop(void)
        return 1;
     }
 
-    putp(tparm(xtermcap, 1));
+    putp(tgoto(xtermcap, 1, 1));
     fflush(stdout);
 
     tcsetattr(0, TCSANOW, &tty);
@@ -85,7 +85,7 @@ raw_loop(void)
        }
     }
 
-    putp(tparm(xtermcap, 0));
+    putp(tgoto(xtermcap, 0, 0));
     fflush(stdout);
     tcsetattr(0, TCSANOW, &old);
     return 0;
@@ -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);