mirror of
https://github.com/apache/nuttx.git
synced 2026-08-20 13:08:26 +00:00
Fix variable 'catd' is used uninitialized whenever 'if' condition is false
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
b2b4ad864b
commit
43e98a5d2d
1 changed files with 2 additions and 2 deletions
|
|
@ -79,14 +79,14 @@ struct catmsg_s
|
|||
static nl_catd catmap(FAR const char *path)
|
||||
{
|
||||
FAR const struct cathdr_s *hdr;
|
||||
nl_catd catd = MAP_FAILED;
|
||||
struct stat st;
|
||||
nl_catd catd;
|
||||
int fd;
|
||||
|
||||
fd = open(path, O_RDONLY | O_CLOEXEC);
|
||||
if (fd < 0)
|
||||
{
|
||||
return MAP_FAILED;
|
||||
return catd;
|
||||
}
|
||||
|
||||
if (fstat(fd, &st) >= 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue