Hi Alec,

I believe you're are right. Making "do while" a "while" will not make any difference for the infinite scenario. Adding a check which you mentioned "checking a value after removing the excess" will resolve the concerns I raised.
Thank you!

Regards,
Avnish Chouhan

Reviewed-by: Avnish Chouhan <avn...@linux.ibm.com>


Hi Avnish,

For the loop, we are incrementing the 'separator' pointer but since we are using a do-while loop, it's happening before we check the escape condition of
the loop.

If I understood the purpose of this loop correctly, I would do something
like this below:

while (*separator == ' ' || *separator == '\t')
   {
     ...
     separator++;
   }


We could write it this way but we would still need to increment the 'separator' pointer before entering the loop since we just wrote an end of string character
where the previous space or tab was.

Alec Brown


Thank you!

Regards,
Avnish Chouhan

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to