Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix assertion with igncr when CR on input #114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

j123b567
Copy link

I have discovered a problem with function do_map. When I run picocom with

--imap igncr

it fails with assertion with CR character on input which it should just ignore.

do_map: Assertion 'n > 0 && n <= M_MAXMAP' failed.

After bisecting the code, it was introduced by commit 50b8e69

It seems that n is also valid for value 0, si this fix allow this value

@jacobq
Copy link

jacobq commented Apr 30, 2021

Seeing same problem still more than a year later (Running on RPi CM4):

picocom: picocom.c:817: do_map: Assertion `n > 0 && n <= M_MAXMAP' failed
# picocom --help
picocom v3.1

Compiled-in options:
  TTY_Q_SZ is 0
  HIGH_BAUD is enabled
  USE_FLOCK is enabled
  LINENOISE is enabled
  HISTFILE is: .picocom_history
  USE_CUSTOM_BAUD is enabled
# picocom --baud 9600 --databits 8 --parity n --stopbits 1 --flow n --imap ignlf  /dev/ttyUSB0
picocom v3.1

port is        : /dev/ttyUSB0
flowcontrol    : none
baudrate is    : 9600
parity is      : none
databits are   : 8
stopbits are   : 1
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
hangup is      : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv -E
imap is        : ignlf,
omap is        : 
emap is        : crcrlf,delbs,
logfile is     : none
initstring     : none
exit_after is  : not set
exit is        : no

Type [C-a] [C-h] to see available commands
Terminal ready
picocom: picocom.c:817: do_map: Assertion `n > 0 && n <= M_MAXMAP' failed.
                                                                          Aborted

@wsakernel
Copy link

Merged as wsakernel@db5f7c5. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants