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

imx_uart: fix option parsing on ARM and other unsigned-char systems #123

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

Commits on Feb 24, 2022

  1. imx_uart: fix option parsing on ARM and other unsigned-char systems

    imx_uart assigns the return value of getopt_long() to a char variable.
    
    On systems that default to unsigned char (e.g. arm, aarch64, powerpc,
    s390) this causes the termination return value -1 to be read as 0xff and
    the option parsing loop never terminates, causing the program to get
    immediately stuck.
    
    Fix that by using an int which is the actual return type of
    getopt_long().
    
    imx_usb already correctly uses int.
    
    Fixes boundarydevices#116.
    
    Signed-off-by: Anssi Hannula <anssi.hannula@bitwise.fi>
    anssih committed Feb 24, 2022
    Configuration menu
    Copy the full SHA
    0f1ba99 View commit details
    Browse the repository at this point in the history