ANDROID: dm: fix dm_substitute_devices()
When candidate is the last parameter, candidate_end points to the '\0' character and not the DM_FIELD_SEP character. In such a situation, we should not move the candidate_end pointer one character backward. Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
This commit is contained in:
parent
5a77db7839
commit
26cab56d9a
1 changed files with 2 additions and 1 deletions
|
@ -176,7 +176,8 @@ static void __init dm_substitute_devices(char *str, size_t str_len)
|
|||
continue;
|
||||
|
||||
/* Temporarily terminate with a nul */
|
||||
candidate_end--;
|
||||
if (*candidate_end)
|
||||
candidate_end--;
|
||||
old_char = *candidate_end;
|
||||
*candidate_end = '\0';
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue