diff options
author | Martin Liska <[email protected]> | 2021-04-19 14:33:36 +0200 |
---|---|---|
committer | Mark Wielaard <[email protected]> | 2021-05-12 11:56:57 +0200 |
commit | adc201f81902f3015a841869756ed4b9b811fe33 (patch) | |
tree | 735ab647b6e749f7bbbd1cd88256f89c2de266a9 /libasm | |
parent | 857546d176a36d2b5dc18b81dcafa3fb8ec0123d (diff) |
Come up with startswith function.
New function in system.h that returns true if a string has a given
prefix, false otherwise. Use it in place of strncmp.
Signed-off-by: Martin Liška <[email protected]>
Diffstat (limited to 'libasm')
-rw-r--r-- | libasm/ChangeLog | 4 | ||||
-rw-r--r-- | libasm/libasmP.h | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/libasm/ChangeLog b/libasm/ChangeLog index 98ac3315..85e723e6 100644 --- a/libasm/ChangeLog +++ b/libasm/ChangeLog @@ -1,3 +1,7 @@ +2021-04-19 Martin Liska <[email protected]> + + * libasmP.h (asm_emit_symbol_p): Use startswith. + 2020-12-16 Dmitry V. Levin <[email protected]> * libasmP.h (_): Remove. diff --git a/libasm/libasmP.h b/libasm/libasmP.h index 8b72f32b..5b5fb776 100644 --- a/libasm/libasmP.h +++ b/libasm/libasmP.h @@ -302,6 +302,6 @@ extern int __disasm_cb_internal (DisasmCtx_t *ctx, const uint8_t **startp, // XXX The second part should probably be controlled by an option which // isn't implemented yet // XXX Also, the format will change with the backend. -#define asm_emit_symbol_p(name) (strncmp (name, ".L", 2) != 0) +#define asm_emit_symbol_p(name) (!startswith (name, ".L")) #endif /* libasmP.h */ |