#2875 assigned defect

src/c/src/lib/libbsp/powerpc/shared/flash/flash.c:841: broken error checking ?

Reported by: David Binderman Owned by: Needs Funding
Priority: normal Milestone: Indefinite
Component: unspecified Version: 4.11
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

src/c/src/lib/libbsp/powerpc/shared/flash/flash.c:841]: (style) Checking if unsigned variable 'got' is less than zero.

Source code is

if ( got < 0 ) {

but

while ( (got = bfill(fd, buf, b->fblksz)) > 0 && sz ) {

and

uint32_t got;

with

static int
bfill(int fd, char *buf, int size)

Suggest use local variable of type int for the return value from bfill.

Change History (2)

comment:1 Changed on 01/20/17 at 13:41:04 by Sebastian Huber

This file is quite sloppy with integer types in general.

comment:2 Changed on 02/15/17 at 14:20:42 by Sebastian Huber

Milestone: 4.12Indefinite
Owner: set to Needs Funding
Status: newassigned
Note: See TracTickets for help on using tickets.