mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-27 07:51:38 +00:00
expo: Correct the logic for duplicate-ID detection
Update scene_txt_str() to account for the possibility that the passed-in str_id may be 0 Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
9767de7b46
commit
408011c2a4
1 changed files with 2 additions and 1 deletions
|
@ -176,8 +176,9 @@ int scene_txt_str(struct scene *scn, const char *name, uint id, uint str_id,
|
|||
ret = expo_str(scn->expo, name, str_id, str);
|
||||
if (ret < 0)
|
||||
return log_msg_ret("str", ret);
|
||||
else if (ret != str_id)
|
||||
if (str_id && ret != str_id)
|
||||
return log_msg_ret("id", -EEXIST);
|
||||
str_id = ret;
|
||||
|
||||
ret = scene_obj_add(scn, name, id, SCENEOBJT_TEXT,
|
||||
sizeof(struct scene_obj_txt),
|
||||
|
|
Loading…
Add table
Reference in a new issue