mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-05-12 11:18:11 -07:00
hf/lf tune: fix segfault when called from script
This commit is contained in:
+2
-1
@@ -3,7 +3,8 @@ All notable changes to this project will be documented in this file.
|
||||
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
|
||||
|
||||
## [unreleased][unreleased]
|
||||
- Add option to set and get maximum read/write block number using `hf_mf_ultimatecard` script (@piotrva)
|
||||
- Fixed `hf/lf tune` segfault when called from script (@doegox)
|
||||
- Added option to set and get maximum read/write block number using `hf_mf_ultimatecard` script (@piotrva)
|
||||
- Added JEDEC information for SPI flash W25Q64JV (@ANTodorov)
|
||||
- Added special iclass legacy config cards in `hf iclass configcard` (@antiklesys)
|
||||
- Added simulation function to `hf iclass legrec` (@antiklesys)
|
||||
|
||||
+10
-6
@@ -696,14 +696,18 @@ void print_progress(uint64_t count, uint64_t max, barMode_t style) {
|
||||
max = (count > max) ? count : max;
|
||||
#if defined(HAVE_READLINE)
|
||||
static int prev_cols = 0;
|
||||
int rows;
|
||||
rl_reset_screen_size(); // refresh Readline idea of the actual screen width
|
||||
rl_get_screen_size(&rows, &cols);
|
||||
int tmp_cols;
|
||||
rl_get_screen_size(NULL, &tmp_cols);
|
||||
// if cols==0: impossible to get screen size, e.g. when scripted
|
||||
if (tmp_cols != 0) {
|
||||
// don't call it if cols==0, it would segfault
|
||||
rl_reset_screen_size(); // refresh Readline idea of the actual screen width
|
||||
rl_get_screen_size(NULL, &cols);
|
||||
|
||||
if (cols < 36)
|
||||
return;
|
||||
if (cols < 36)
|
||||
return;
|
||||
}
|
||||
|
||||
(void) rows;
|
||||
if (prev_cols > cols) {
|
||||
PrintAndLogEx(NORMAL, _CLEAR_ _TOP_ "");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user