mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
hf/lf tune: fix segfault when called from script
This commit is contained in:
parent
b75818116a
commit
23e6aa40b7
2 changed files with 12 additions and 7 deletions
|
@ -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...
|
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]
|
## [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 JEDEC information for SPI flash W25Q64JV (@ANTodorov)
|
||||||
- Added special iclass legacy config cards in `hf iclass configcard` (@antiklesys)
|
- Added special iclass legacy config cards in `hf iclass configcard` (@antiklesys)
|
||||||
- Added simulation function to `hf iclass legrec` (@antiklesys)
|
- Added simulation function to `hf iclass legrec` (@antiklesys)
|
||||||
|
|
|
@ -696,14 +696,18 @@ void print_progress(uint64_t count, uint64_t max, barMode_t style) {
|
||||||
max = (count > max) ? count : max;
|
max = (count > max) ? count : max;
|
||||||
#if defined(HAVE_READLINE)
|
#if defined(HAVE_READLINE)
|
||||||
static int prev_cols = 0;
|
static int prev_cols = 0;
|
||||||
int rows;
|
int tmp_cols;
|
||||||
rl_reset_screen_size(); // refresh Readline idea of the actual screen width
|
rl_get_screen_size(NULL, &tmp_cols);
|
||||||
rl_get_screen_size(&rows, &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)
|
if (cols < 36)
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
(void) rows;
|
|
||||||
if (prev_cols > cols) {
|
if (prev_cols > cols) {
|
||||||
PrintAndLogEx(NORMAL, _CLEAR_ _TOP_ "");
|
PrintAndLogEx(NORMAL, _CLEAR_ _TOP_ "");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue