Skip to content
Commit f352c546 authored by Lingkai Dong's avatar Lingkai Dong Committed by Rob Walton
Browse files

littlefs example: Fix use of uninitialized variable



The littlefs example stores the status of closing a file in `close_ret`.
If an error happens before a file is even opened, no closing is
performed and `close_ret` is not set. To avoid problems when we check
its value near the end of the `main()` and decide the application's
return value, initialize `close_ret` (and `unmount_ret` to be extra
safe in case we make further code changes in the future) to zero.

This issue was warned by the compiler.

Signed-off-by: Lingkai Dong's avatarLingkai Dong <lingkai.dong@arm.com>
parent b5b5d6e7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment