]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - progs/tput.c
ncurses 6.4 - patch 20240420
[ncurses.git] / progs / tput.c
index 41508b72777b0229cfcf3046bac05cd59aa7d3a7..f9321b60a8d3f5c08a9afa45261e944b6d3d25e8 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2022,2023 Thomas E. Dickey                                *
+ * Copyright 2018-2023,2024 Thomas E. Dickey                                *
  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -47,7 +47,7 @@
 #include <transform.h>
 #include <tty_settings.h>
 
-MODULE_ID("$Id: tput.c,v 1.102 2023/04/08 16:26:36 tom Exp $")
+MODULE_ID("$Id: tput.c,v 1.104 2024/04/20 22:20:51 tom Exp $")
 
 #define PUTS(s)                fputs(s, stdout)
 
@@ -178,7 +178,13 @@ tput_cmd(int fd, TTY * settings, int argc, char **argv, int *used)
        }
 
 #if HAVE_SIZECHANGE
-       set_window_size(fd, &lines, &columns);
+       {
+           NCURSES_INT2 my_rows = lines;
+           NCURSES_INT2 my_cols = columns;
+           set_window_size(fd, &my_rows, &my_cols);
+           lines = my_rows;
+           columns = my_cols;
+       }
 #else
        (void) fd;
 #endif
@@ -283,7 +289,7 @@ tput_cmd(int fd, TTY * settings, int argc, char **argv, int *used)
            provided = 0;
            for (narg = 1; narg < argc; ++narg) {
                char *ending = NULL;
-               long check = strtol(argv[narg], &ending, 10);
+               long check = strtol(argv[narg], &ending, 0);
                if (check < 0 || ending == argv[narg] || *ending != '\0')
                    break;
                provided = narg;