On 2025-06-04 01:17, Alec Brown wrote:
On Thu, May 29, 2025 at 6:59 AM, Avnish Chouhan <avn...@linux.ibm.com>
wrote:
On 2025-05-21 18:21, grub-devel-requ...@gnu.org wrote:
[...]
> + while (*separator == ' ' || *separator == '\t');
What's the use of this while condition? It may result in an infinite
loop...
The purpose of this while loop is to remove any additional spaces or
tabs
separating the key from the value. I don't believe this would result in
an
infinite loop unless the rest of memory was a space or tab. However, an
issue
I do see is we aren't checking if there is a value after removing the
excess
spaces and tabs in the loop. I'll fix this.
Hi Alec,
In my opinion, if we have any of the given condition evaluates as
'True', it will be an infinite loop. We are't incriminating the pointer
and we will be in a loop forever if "*separator == ' ' or *separator ==
'\t'" evaluates 'True'.
If I understood the purpose of this loop correctly, I would do something
like this below:
while (*separator == ' ' || *separator == '\t')
{
...
separator++;
}
Thank you!
Regards,
Avnish Chouhan
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel