Commit bd355213 authored by Dong Du's avatar Dong Du Committed by Anup Patel
Browse files

lib: sbi: Refine the way to construct platform features



sbi_platform_get_features_str() uses sbi_snprintf() to construct the
features_str. However, it passes the wrong length value (i.e., the nfstr),
which should be (nfstr-offset) as the starting point of str (i.e.,
features_str + offset) changes.

This commit also checks the return value of snprintf, and handles the
corner case that the string buffer is full.

Signed-off-by: default avatarDong Du <Dd_nirvana@sjtu.edu.cn>
Reviewed-by: default avatarAtish Patra <atish.patra@wdc.com>
parent 1718b164
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment