poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/6] ios: Check ios->handler_normalize for memory allocation


From: Jose E. Marchesi
Subject: Re: [PATCH 3/6] ios: Check ios->handler_normalize for memory allocation error.
Date: Fri, 08 May 2020 00:08:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

    > Why would be want to check for `errno' after calling handler_normalize?
    > The function does not return any error code.

    
    handler_normalize returns a new handler which is a newly allocated
    string. Therefore, checking for errors is reasonable. Maybe we should 
    change the signature, tough. If it wrote the new handler to a pointer
    we give it to, for example, we could reserve the return value for NULL
    for success and error_no for failure.

Yeah, changing the interface of the function to return error codes
sounds like the right thing to do.

We can introduce an IOK_OK code in ios-dev.h for that purpose.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]