From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Wed, 18 Jan 2017 17:47:39 +0100 Subject: [U-Boot] [PATCH v2 15/18] tools: kwbimage: Refactor line parsing and fix error In-Reply-To: <20170111150102.7399-16-mario.six@gdsys.cc> References: <20170111150102.7399-1-mario.six@gdsys.cc> <20170111150102.7399-16-mario.six@gdsys.cc> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 11.01.2017 16:00, Mario Six wrote: > The function image_create_config_parse_oneline is pretty complex, and > since more parameters will be added to support secure booting, we > refactor the function to make it more readable. > > Also, when a line contained just a keyword without any parameters, > strtok_r returned NULL, which was then indiscriminately fed into atoi, > causing a segfault. To correct this, we add a NULL check before feeding > the extracted token to atoi, and print an error message in case the > token is NULL. > > Signed-off-by: Mario Six > --- > Changes in v2: > > None Reviewed-by: Stefan Roese Thanks, Stefan