Commit 80aae926 authored by Bernhard Nortmann's avatar Bernhard Nortmann
Browse files

fexc: Warn when decompiling a malformed section entry (key string)



script_bin.c decompiles section entries even if they have invalid
indentifiers. Thus malformed .bin files were observed to result in
a .fex that couldn't be processed successfully with the sunxi-fexc
compiler.

This patch makes bin2fex now issue a warning for this kind of keys,
so that they're easier to notice and correct.
Signed-off-by: default avatarBernhard Nortmann <bernhard.nortmann@web.de>
parent a93b5e36
......@@ -17,6 +17,7 @@
#include "common.h"
#include <ctype.h>
#include <errno.h>
#include <stdlib.h>
#include <stdint.h>
......@@ -240,6 +241,13 @@ static int decompile_section(void *bin, size_t bin_size,
type = (entry->pattern >> 16) & 0xffff;
words = (entry->pattern >> 0) & 0xffff;
for (char *p = entry->name; *p; p++)
if (!(isalnum(*p) || *p == '_')) {
pr_info("Warning: Malformed entry key \"%s\"\n",
entry->name);
break;
}
switch(type) {
case SCRIPT_VALUE_TYPE_SINGLE_WORD: {
uint32_t *v = data;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment