Merge remote-tracking branch 'OFW/dev' into dev

This commit is contained in:
MX
2024-12-21 17:37:08 +03:00
18 changed files with 450 additions and 94 deletions
+1 -3
View File
@@ -830,9 +830,7 @@ void elf_file_free(ELFFile* elf) {
for(ELFSectionDict_it(it, elf->sections); !ELFSectionDict_end_p(it);
ELFSectionDict_next(it)) {
const ELFSectionDict_itref_t* itref = ELFSectionDict_cref(it);
if(itref->value.data) {
aligned_free(itref->value.data);
}
aligned_free(itref->value.data);
if(itref->value.fast_rel) {
if(itref->value.fast_rel->data) {
aligned_free(itref->value.fast_rel->data);
+13 -7
View File
@@ -44,18 +44,24 @@ wrapped_fn_list = [
"vsiprintf",
"vsniprintf",
#
# Scanf is not implemented 4 now
# standard input
#
"fgetc",
"getc",
"getchar",
"fgets",
"ungetc",
#
# standard input, but unimplemented
#
"gets",
#
# scanf, not implemented for now
#
# "fscanf",
# "scanf",
# "sscanf",
# "vsprintf",
# "fgetc",
# "fgets",
# "getc",
# "getchar",
# "gets",
# "ungetc",
# "vfscanf",
# "vscanf",
# "vsscanf",
+45 -2
View File
@@ -51,11 +51,54 @@ int __wrap_snprintf(char* str, size_t size, const char* format, ...) {
}
int __wrap_fflush(FILE* stream) {
UNUSED(stream);
furi_thread_stdout_flush();
if(stream == stdout) furi_thread_stdout_flush();
return 0;
}
int __wrap_fgetc(FILE* stream) {
if(stream != stdin) return EOF;
char c;
if(furi_thread_stdin_read(&c, 1, FuriWaitForever) == 0) return EOF;
return c;
}
int __wrap_getc(FILE* stream) {
return __wrap_fgetc(stream);
}
int __wrap_getchar(void) {
return __wrap_fgetc(stdin);
}
char* __wrap_fgets(char* str, size_t n, FILE* stream) {
// leave space for the zero terminator
furi_check(n >= 1);
n--;
if(stream != stdin) {
*str = '\0';
return str;
}
// read characters
int c;
do {
c = __wrap_fgetc(stdin);
if(c > 0) *(str++) = c;
} while(c != EOF && c != '\n' && --n);
// place zero terminator
*str = '\0';
return str;
}
int __wrap_ungetc(int ch, FILE* stream) {
char c = ch;
if(stream != stdin) return EOF;
furi_thread_stdin_unread(&c, 1);
return ch;
}
__attribute__((__noreturn__)) void __wrap___assert(const char* file, int line, const char* e) {
UNUSED(file);
UNUSED(line);
+6
View File
@@ -16,6 +16,12 @@ int __wrap_putc(int ch, FILE* stream);
int __wrap_snprintf(char* str, size_t size, const char* format, ...);
int __wrap_fflush(FILE* stream);
int __wrap_fgetc(FILE* stream);
int __wrap_getc(FILE* stream);
int __wrap_getchar(void);
char* __wrap_fgets(char* str, size_t n, FILE* stream);
int __wrap_ungetc(int ch, FILE* stream);
__attribute__((__noreturn__)) void __wrap___assert(const char* file, int line, const char* e);
__attribute__((__noreturn__)) void
@@ -245,6 +245,8 @@ static Iso15693ParserCommand iso15693_parser_parse_1_out_of_256(Iso15693Parser*
instance->parsed_frame, instance->next_byte_part * 4 + j / 2);
}
}
} else {
instance->zero_found = true;
}
}
instance->next_byte_part = (instance->next_byte_part + 1) % 64;