Skip to content
Snippets Groups Projects
Commit 69067a34 authored by Andreas Fenkart's avatar Andreas Fenkart Committed by Tom Rini
Browse files

tools: env: fw_parse_script: simplify removal of newline/carriage return


fgets returns when the first '\n' is found

Signed-off-by: default avatarAndreas Fenkart <andreas.fenkart@digitalstrom.com>
parent 938c29ff
No related branches found
No related tags found
No related merge requests found
......@@ -566,14 +566,12 @@ int fw_parse_script(char *fname)
}
/* Drop ending line feed / carriage return */
while (len > 0 && (dump[len - 1] == '\n' ||
dump[len - 1] == '\r')) {
dump[len - 1] = '\0';
len--;
}
dump[--len] = '\0';
if (len && dump[len - 1] == '\r')
dump[--len] = '\0';
/* Skip comment or empty lines */
if ((len == 0) || dump[0] == '#')
if (len == 0 || dump[0] == '#')
continue;
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment