summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/boot/efi/util.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/boot/efi/util.c b/src/boot/efi/util.c
index 3639afcb15..aafaf06e98 100644
--- a/src/boot/efi/util.c
+++ b/src/boot/efi/util.c
@@ -42,19 +42,17 @@ static bool shall_be_whitespace(char16_t c) {
}
char16_t* mangle_stub_cmdline(char16_t *cmdline) {
- char16_t *p, *q, *e;
-
if (!cmdline)
return cmdline;
- p = q = cmdline;
-
/* Skip initial whitespace */
- while (shall_be_whitespace(*p))
+ const char16_t *p = cmdline;
+ while (*p != 0 && shall_be_whitespace(*p))
p++;
/* Turn inner control characters into proper spaces */
- for (e = p; *p != 0; p++) {
+ char16_t *e = cmdline;
+ for (char16_t *q = cmdline; *p != 0; p++) {
if (shall_be_whitespace(*p)) {
*(q++) = ' ';
continue;