From e2bbe2b14eb0b0b02d145cbf3258d1d4c3dd606b Mon Sep 17 00:00:00 2001 From: pancake Date: Mon, 4 Jul 2022 17:42:25 +0200 Subject: [PATCH] Add a linting to avoid R_LOG calls ending with a dot ##lint --- libr/anal/arch/v850np/v850dis.c | 2 +- libr/anal/dwarf_process.c | 2 +- libr/anal/esil_trace.c | 8 ++++---- libr/anal/fcn.c | 4 ++-- libr/anal/p/anal_avr.c | 4 ++-- libr/anal/p/anal_java.c | 4 ++-- libr/anal/rtti_msvc.c | 8 ++++---- libr/anal/var.c | 6 +++--- libr/asm/arch/pyc/opcode.c | 2 +- libr/asm/asm.c | 6 +++--- libr/bin/bin.c | 8 ++++---- libr/bin/bobj.c | 2 +- libr/bin/dwarf.c | 2 +- libr/bin/format/elf/elf.c | 4 ++-- libr/bin/format/pe/pe.c | 2 +- libr/bin/p/bin_dex.c | 14 +++++++------- libr/bin/p/bin_mach0.c | 2 +- libr/bin/pdb/pdb.c | 14 +++++++------- libr/bp/bp.c | 6 +++--- libr/cons/cons.c | 2 +- libr/cons/editor.c | 4 ++-- libr/cons/hud.c | 4 ++-- libr/cons/less.c | 2 +- libr/core/anal_tp.c | 4 ++-- libr/core/canal.c | 8 ++++---- libr/core/cbin.c | 10 +++++----- libr/core/cconfig.c | 8 ++++---- libr/core/cfile.c | 4 ++-- libr/core/cmd.c | 4 ++-- libr/core/cmd_anal.c | 16 ++++++++-------- libr/core/cmd_type.c | 2 +- libr/core/p/core_java.c | 12 ++++++------ libr/core/rtr.c | 6 +++--- libr/core/windows_heap.c | 16 ++++++++-------- libr/debug/dsession.c | 8 ++++---- libr/debug/p/debug_gdb.c | 2 +- libr/debug/p/debug_native.c | 4 ++-- libr/debug/p/debug_rap.c | 2 +- libr/debug/p/native/windows/windows_debug.c | 1 - libr/debug/snap.c | 2 +- libr/debug/trace.c | 2 +- libr/egg/egg.c | 4 ++-- libr/io/p/io_debug.c | 12 ++++++------ libr/io/p/io_self.c | 2 +- libr/io/p/io_zip.c | 4 ++-- libr/main/radare2.c | 2 +- libr/reg/profile.c | 2 +- libr/socket/run.c | 4 ++-- libr/socket/socket.c | 4 ++-- libr/util/file.c | 3 +-- libr/util/punycode.c | 11 ++++------- libr/util/str.c | 2 +- sys/lint.sh | 1 + test/db/cmd/cmd_interactive_modes | 4 ++-- 54 files changed, 137 insertions(+), 141 deletions(-) diff --git a/libr/anal/arch/v850np/v850dis.c b/libr/anal/arch/v850np/v850dis.c index 467b12ba23..a3df9d5a8b 100644 --- a/libr/anal/arch/v850np/v850dis.c +++ b/libr/anal/arch/v850np/v850dis.c @@ -428,7 +428,7 @@ static bool v850np_disassemble(v850np_inst *inst, int cpumodel, ut64 memaddr, co bool invalid = false; value = get_operand_value (operand, insn, buffer + 2, buffer_size - 2, &invalid); if (invalid) { - // R_LOG_WARN ("Cannot get operand value."); + // R_LOG_WARN ("Cannot get operand value"); break; } diff --git a/libr/anal/dwarf_process.c b/libr/anal/dwarf_process.c index d68fe3c56c..c9cae8b113 100644 --- a/libr/anal/dwarf_process.c +++ b/libr/anal/dwarf_process.c @@ -273,7 +273,7 @@ static st32 parse_type(Context *ctx, const ut64 offset, RStrBuf *strbuf, ut64 *s *visited = su; } if (visited && set_u_contains (*visited, offset)) { - R_LOG_WARN ("anal.dwarf.parse_type: infinite recursion detected."); + R_LOG_WARN ("anal.dwarf.parse_type: infinite recursion detected"); return -1; } set_u_add (*visited, offset); diff --git a/libr/anal/esil_trace.c b/libr/anal/esil_trace.c index c927ac5844..ac986958b6 100644 --- a/libr/anal/esil_trace.c +++ b/libr/anal/esil_trace.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2015-2020 - pancake, rkx1209 */ +/* radare - LGPL - Copyright 2015-2022 - pancake, rkx1209 */ #include @@ -19,7 +19,7 @@ static void htup_vector_free(HtUPKv *kv) { R_API RAnalEsilTrace *r_anal_esil_trace_new(RAnalEsil *esil) { r_return_val_if_fail (esil, NULL); if (!esil->stack_addr || !esil->stack_size) { - eprintf ("Run `aeim` to initialize a stack for the ESIL vm\n"); + R_LOG_ERROR ("Run `aeim` to initialize a stack for the ESIL vm"); return NULL; } size_t i; @@ -88,7 +88,7 @@ static void add_reg_change(RAnalEsilTrace *trace, int idx, RRegItem *ri, ut64 da if (!vreg) { vreg = r_vector_new (sizeof (RAnalEsilRegChange), NULL, NULL); if (!vreg) { - R_LOG_ERROR ("creating a register vector."); + R_LOG_ERROR ("creating a register vector"); return; } ht_up_insert (trace->registers, addr, vreg); @@ -103,7 +103,7 @@ static void add_mem_change(RAnalEsilTrace *trace, int idx, ut64 addr, ut8 data) if (!vmem) { vmem = r_vector_new (sizeof (RAnalEsilMemChange), NULL, NULL); if (!vmem) { - R_LOG_ERROR ("creating a memory vector."); + R_LOG_ERROR ("creating a memory vector"); return; } ht_up_insert (trace->memory, addr, vmem); diff --git a/libr/anal/fcn.c b/libr/anal/fcn.c index 4fa82bdf5f..61673e563c 100644 --- a/libr/anal/fcn.c +++ b/libr/anal/fcn.c @@ -667,7 +667,7 @@ static int fcn_recurse(RAnal *anal, RAnalFunction *fcn, ut64 addr, ut64 len, int } if ((maxlen - (addrbytes * idx)) > MAX_SCAN_SIZE) { if (anal->verbose) { - R_LOG_WARN ("Skipping large memory region."); + R_LOG_WARN ("Skipping large memory region"); } maxlen = 0; } @@ -1690,7 +1690,7 @@ R_API RAnalFunction *r_anal_get_function_byname(RAnal *a, const char *name) { R_API bool r_anal_function_add_bb(RAnal *a, RAnalFunction *fcn, ut64 addr, ut64 size, ut64 jump, ut64 fail, R_BORROW RAnalDiff *diff) { D eprintf ("Add bb\n"); if (size == 0) { // empty basic blocks allowed? - R_LOG_WARN ("empty basic block at 0x%08"PFMT64x" is not allowed. pending discussion.", addr); + R_LOG_WARN ("empty basic block at 0x%08"PFMT64x" is not allowed. pending discussion", addr); r_warn_if_reached (); return false; } diff --git a/libr/anal/p/anal_avr.c b/libr/anal/p/anal_avr.c index 9be1146c29..0cfc1b7849 100644 --- a/libr/anal/p/anal_avr.c +++ b/libr/anal/p/anal_avr.c @@ -171,7 +171,7 @@ static CPU_MODEL *__get_cpu_model_recursive(const char *model) { if (cpu && cpu->inherit && !cpu->inherit_cpu_p) { cpu->inherit_cpu_p = get_cpu_model (cpu->inherit); if (!cpu->inherit_cpu_p) { - R_LOG_ERROR ("Cannot inherit from unknown CPU model '%s'.", cpu->inherit); + R_LOG_ERROR ("Cannot inherit from unknown CPU model '%s'", cpu->inherit); } } return cpu; @@ -209,7 +209,7 @@ static CPU_CONST *const_by_name(CPU_MODEL *cpu, int type, char *c) { if (cpu->inherit_cpu_p) { return const_by_name (cpu->inherit_cpu_p, type, c); } - R_LOG_ERROR ("CONSTANT key[%s] NOT FOUND.", c); + R_LOG_ERROR ("CONSTANT key[%s] NOT FOUND", c); return NULL; } diff --git a/libr/anal/p/anal_java.c b/libr/anal/p/anal_java.c index 850384d13e..369e9f2855 100644 --- a/libr/anal/p/anal_java.c +++ b/libr/anal/p/anal_java.c @@ -197,7 +197,7 @@ static int java_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len } IFDBG { R_LOG_DEBUG ("Extracting op from buffer (%d byte(s)) @ 0x%04x", (int)len, (ut32)addr); - R_LOG_DEBUG ("Parsing op: (0x%02x) %s.", op_byte, JAVA_OPS[op_byte].name); + R_LOG_DEBUG ("Parsing op: (0x%02x) %s", op_byte, JAVA_OPS[op_byte].name); } op->addr = addr; op->size = sz; @@ -252,7 +252,7 @@ static int java_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len op->eob = r_anal_java_is_op_type_eop (op->type2); IFDBG { const char *ot_str = r_anal_optype_to_string (op->type); - R_LOG_DEBUG ("op_type2: %s @ 0x%04"PFMT64x" 0x%08"PFMT64x" op_type: (0x%02"PFMT64x") %s.", + R_LOG_DEBUG ("op_type2: %s @ 0x%04"PFMT64x" 0x%08"PFMT64x" op_type: (0x%02"PFMT64x") %s", JAVA_OPS[op_byte].name, addr, (ut64)op->type2, (ut64)op->type, ot_str); //eprintf ("op_eob: 0x%02x.\n", op->eob); //eprintf ("op_byte @ 0: 0x%02x op_byte @ 0x%04x: 0x%02x.\n", data[0], addr, data[addr]); diff --git a/libr/anal/rtti_msvc.c b/libr/anal/rtti_msvc.c index 93530bb4d1..4a31fec906 100644 --- a/libr/anal/rtti_msvc.c +++ b/libr/anal/rtti_msvc.c @@ -169,7 +169,7 @@ static RList *rtti_msvc_read_base_class_array(RVTableContext *context, ut32 num_ if (num_base_classes > BASE_CLASSES_MAX) { if (context->anal->verbose) { - R_LOG_WARN ("Length of base class array at 0x%08"PFMT64x" exceeds %d.", addr, BASE_CLASSES_MAX); + R_LOG_WARN ("Length of base class array at 0x%08"PFMT64x" exceeds %d", addr, BASE_CLASSES_MAX); } num_base_classes = BASE_CLASSES_MAX; } @@ -769,7 +769,7 @@ RecoveryCompleteObjectLocator *recovery_anal_complete_object_locator(RRTTIMSVCAn } if (!td->valid) { if (context->vt_context->anal->verbose) { - R_LOG_WARN ("type descriptor of base is invalid."); + R_LOG_WARN ("type descriptor of base is invalid"); } continue; } @@ -865,7 +865,7 @@ static void recovery_apply_bases(RRTTIMSVCAnalContext *context, const char *clas const char *base_class_name; if (!base_td->col) { if (context->vt_context->anal->verbose) { - R_LOG_WARN ("Base td %s has no col. Falling back to recovery from td only.", base_td->td.name); + R_LOG_WARN ("Base td %s has no col. Falling back to recovery from td only", base_td->td.name); } base_class_name = recovery_apply_type_descriptor (context, base_td); } else { @@ -874,7 +874,7 @@ static void recovery_apply_bases(RRTTIMSVCAnalContext *context, const char *clas if (!base_class_name) { if (context->vt_context->anal->verbose) { - eprintf ("Failed to convert !base td->col or td to a class\n"); + R_LOG_WARN ("Failed to convert !base td->col or td to a class"); } continue; } diff --git a/libr/anal/var.c b/libr/anal/var.c index 95d4e1dde9..e4d72c41dd 100644 --- a/libr/anal/var.c +++ b/libr/anal/var.c @@ -941,7 +941,7 @@ static void extract_arg(RAnal *anal, RAnalFunction *fcn, RAnalOp *op, const char const char *rn = op->dst->reg ? op->dst->reg->name : NULL; if (rn && ((bp && !strcmp (bp, rn)) || (sp && !strcmp (sp, rn)))) { if (anal->verbose) { - R_LOG_WARN ("Analysis didn't fill op->stackop for instruction that alters stack at 0x%" PFMT64x ".", op->addr); + R_LOG_WARN ("Analysis didn't fill op->stackop for instruction that alters stack at 0x%" PFMT64x, op->addr); } goto beach; } @@ -969,7 +969,7 @@ static void extract_arg(RAnal *anal, RAnalFunction *fcn, RAnalOp *op, const char } if (anal->verbose && (!op->src[0] || !op->dst)) { - R_LOG_WARN ("Analysis didn't fill op->src/dst at 0x%" PFMT64x ".", op->addr); + R_LOG_WARN ("Analysis didn't fill op->src/dst at 0x%" PFMT64x, op->addr); } int rw = (op->direction == R_ANAL_OP_DIR_WRITE) ? R_ANAL_VAR_ACCESS_TYPE_WRITE : R_ANAL_VAR_ACCESS_TYPE_READ; @@ -1741,7 +1741,7 @@ R_API char *r_anal_function_format_sig(R_NONNULL RAnal *anal, R_NONNULL RAnalFun const char *name = r_type_func_args_name (TDB, type_fcn_name, i); if (!type || !*type || !name) { // USE RLOG API - R_LOG_WARN ("Missing type for '%s'.", type_fcn_name); + R_LOG_WARN ("Missing type for '%s'", type_fcn_name); goto beach; } size_t len = strlen (type); diff --git a/libr/asm/arch/pyc/opcode.c b/libr/asm/arch/pyc/opcode.c index aba51faf77..7de94eb480 100644 --- a/libr/asm/arch/pyc/opcode.c +++ b/libr/asm/arch/pyc/opcode.c @@ -245,7 +245,7 @@ void (store_opN)(struct op_parameter par) { def_op (.op_obj = par.op_obj, .op_name = par.op_name, .op_code = par.op_code, .pop = par.pop, .push = par.push); break; default: - R_LOG_ERROR ("Error in store_op in opcode.c, call function %u.", par.func); + R_LOG_ERROR ("Error in store_op in opcode.c, call function %u", par.func); return; } par.op_obj[par.op_code].type |= HASSTORE; diff --git a/libr/asm/asm.c b/libr/asm/asm.c index ccf3eb6f3f..51e3545b1a 100644 --- a/libr/asm/asm.c +++ b/libr/asm/asm.c @@ -67,7 +67,7 @@ static inline int r_asm_pseudo_arch(RAsm *a, const char *input) { static inline int r_asm_pseudo_bits(RAsm *a, const char *input) { if (!(r_asm_set_bits (a, r_num_math (NULL, input)))) { - R_LOG_ERROR ("Unsupported value for .bits."); + R_LOG_ERROR ("Unsupported value for .bits"); return -1; } return 0; @@ -179,7 +179,7 @@ static inline int r_asm_pseudo_incbin(RAsmOp *op, char *input) { size_t count = (size_t)r_num_math (NULL,r_str_word_get0 (input, 2)); char *content = r_file_slurp (input, &bytes_read); if (!content) { - R_LOG_ERROR ("Could not open '%s'.", input); + R_LOG_ERROR ("Could not open '%s'", input); return -1; } if (skip > 0) { @@ -1078,7 +1078,7 @@ R_API RAsmCode *r_asm_massemble(RAsm *a, const char *assembly) { ret = r_asm_pseudo_org (a, ptr + 5); off = a->pc; } else if (r_str_startswith (ptr, ".offset ")) { - R_LOG_ERROR ("Invalid use of the .offset directory. This directive is only supported in r2 -c 'waf'."); + R_LOG_ERROR ("Invalid use of the .offset directory. This directive is only supported in r2 -c 'waf'"); } else if (!strncmp (ptr, ".text", 5)) { acode->code_offset = a->pc; } else if (!strncmp (ptr, ".data", 5)) { diff --git a/libr/bin/bin.c b/libr/bin/bin.c index 2bfaffd289..54e0faf84d 100644 --- a/libr/bin/bin.c +++ b/libr/bin/bin.c @@ -646,7 +646,7 @@ R_API void r_bin_set_baddr(RBin *bin, ut64 baddr) { } } } else { - R_LOG_WARN ("This should be an assert probably."); + R_LOG_WARN ("This should be an assert probably"); } // XXX - update all the infos? // maybe in RBinFile.rebase() ? @@ -1109,7 +1109,7 @@ R_API void r_bin_list_archs(RBin *bin, PJ *pj, int mode) { "0x%08" PFMT64x ":%" PFMT64u ":%s:%d", boffset, obj_size, "unk", 0); } else { - R_LOG_ERROR ("Invalid RBinFile."); + R_LOG_ERROR ("Invalid RBinFile"); } //sdb_array_push (binfile_sdb, ARCHS_KEY, archline, 0); } @@ -1151,11 +1151,11 @@ R_API RBuffer *r_bin_create(RBin *bin, const char *p, RBinPlugin *plugin = r_bin_get_binplugin_by_name (bin, p); if (!plugin) { - R_LOG_WARN ("Cannot find RBin plugin named '%s'.", p); + R_LOG_WARN ("Cannot find RBin plugin named '%s'", p); return NULL; } if (!plugin->create) { - R_LOG_WARN ("RBin plugin '%s' does not implement \"create\" method.", p); + R_LOG_WARN ("RBin plugin '%s' does not implement \"create\" method", p); return NULL; } codelen = R_MAX (codelen, 0); diff --git a/libr/bin/bobj.c b/libr/bin/bobj.c index ebe6d998b6..26338bd457 100644 --- a/libr/bin/bobj.c +++ b/libr/bin/bobj.c @@ -155,7 +155,7 @@ R_IPI RBinObject *r_bin_object_new(RBinFile *bf, RBinPlugin *plugin, ut64 basead return NULL; } } else { - R_LOG_WARN ("Plugin %s should implement load_buffer method.", plugin->name); + R_LOG_WARN ("Plugin %s should implement load_buffer method", plugin->name); sdb_free (bo->kv); free (bo); return NULL; diff --git a/libr/bin/dwarf.c b/libr/bin/dwarf.c index a01c21401d..9cd8c25088 100644 --- a/libr/bin/dwarf.c +++ b/libr/bin/dwarf.c @@ -2088,7 +2088,7 @@ static RBinDwarfDebugInfo *parse_info_raw(Sdb *sdb, RBinDwarfDebugAbbrev *da, } if (da->decls->count >= da->capacity) { - R_LOG_WARN ("malformed dwarf have not enough buckets for decls."); + R_LOG_WARN ("malformed dwarf have not enough buckets for decls"); } r_warn_if_fail (da->count <= da->capacity); diff --git a/libr/bin/format/elf/elf.c b/libr/bin/format/elf/elf.c index c5ba5b4292..d236c76510 100644 --- a/libr/bin/format/elf/elf.c +++ b/libr/bin/format/elf/elf.c @@ -2631,7 +2631,7 @@ ut8 *Elf_(r_bin_elf_grab_regstate)(ELFOBJ *bin, int *len) { return buf; } } - R_LOG_DEBUG ("Cannot find NOTE section."); + R_LOG_DEBUG ("Cannot find NOTE section"); return NULL; } @@ -3720,7 +3720,7 @@ static RBinElfSymbol* Elf_(_r_bin_elf_get_symbols_imports)(ELFOBJ *bin, int type } void *rett = realloc (ret, (ret_size + nsym) * sizeof (RBinElfSymbol)); if (!rett) { - R_LOG_ERROR ("Cannot allocate %d symbols.", (int)(nsym + ret_size)); + R_LOG_ERROR ("Cannot allocate %d symbols", (int)(nsym + ret_size)); goto beach; } ret = rett; diff --git a/libr/bin/format/pe/pe.c b/libr/bin/format/pe/pe.c index 5cabfa13d2..37e1209a24 100644 --- a/libr/bin/format/pe/pe.c +++ b/libr/bin/format/pe/pe.c @@ -4145,7 +4145,7 @@ void PE_(r_bin_pe_check_sections)(RBinPEObj* pe, struct r_bin_pe_section_t* * se if (addr_beg <= entry->vaddr || entry->vaddr < addr_end) { if (!(sections[j].perm & PE_IMAGE_SCN_MEM_EXECUTE)) { if (pe->verbose) { - R_LOG_WARN ("Found entrypoint in non-executable section."); + R_LOG_WARN ("Found entrypoint in non-executable section"); } sections[j].perm |= PE_IMAGE_SCN_MEM_EXECUTE; } diff --git a/libr/bin/p/bin_dex.c b/libr/bin/p/bin_dex.c index 9687f55547..3c39ec350a 100644 --- a/libr/bin/p/bin_dex.c +++ b/libr/bin/p/bin_dex.c @@ -262,7 +262,7 @@ static char *dex_get_proto(RBinDexObj *bin, int proto_id) { // size of the list, in 16 bit entries ut32 list_size = r_read_le32 (params_buf); if (list_size >= ST32_MAX) { - R_LOG_WARN ("function prototype contains too many parameters (> 2 million)."); + R_LOG_WARN ("function prototype contains too many parameters (> 2 million)"); list_size = ST32_MAX; } size_t typeidx_bufsize = (list_size * sizeof (ut16)); @@ -1925,27 +1925,27 @@ static void add_segment(RList *ret, const char *name, Section s, int perm) { static bool validate_section(const char *name, Section *pre, Section *cur, Section *nex, Section *all) { r_return_val_if_fail (cur && all, false); if (pre && cur->addr < (pre->addr + pre->size)) { - R_LOG_WARN ("%s Section starts before the previous.", name); + R_LOG_WARN ("%s Section starts before the previous", name); } if (cur->addr >= all->size) { - R_LOG_WARN ("%s section starts beyond the end of the file.", name); + R_LOG_WARN ("%s section starts beyond the end of the file", name); return false; } if (cur->addr == UT64_MAX) { - R_LOG_WARN ("%s invalid region size.", name); + R_LOG_WARN ("%s invalid region size", name); return false; } if ((cur->addr + cur->size) > all->size) { - R_LOG_WARN ("%s truncated section because of file size.", name); + R_LOG_WARN ("%s truncated section because of file size", name); cur->size = all->size - cur->addr; } if (nex) { if (cur->addr >= nex->addr) { - R_LOG_WARN ("invalid %s section address.", name); + R_LOG_WARN ("invalid %s section address", name); return false; } if ((cur->addr + cur->size) > nex->addr) { - R_LOG_WARN ("truncated %s with next section size.", name); + R_LOG_WARN ("truncated %s with next section size", name); cur->size = nex->addr - cur->addr; } } diff --git a/libr/bin/p/bin_mach0.c b/libr/bin/p/bin_mach0.c index 707193b2dd..1036e1d444 100644 --- a/libr/bin/p/bin_mach0.c +++ b/libr/bin/p/bin_mach0.c @@ -547,7 +547,7 @@ static bool _patch_reloc(struct MACH0_(obj_t) *bin, RIOBind *iob, struct reloc_t ins_len = 5; break; default: - R_LOG_WARN ("unsupported reloc type for X86_64 (%d), please file a bug.", reloc->type); + R_LOG_WARN ("unsupported reloc type for X86_64 (%d), please file a bug", reloc->type); return false; } break; diff --git a/libr/bin/pdb/pdb.c b/libr/bin/pdb/pdb.c index 8b52dd65ff..4b9942a50d 100644 --- a/libr/bin/pdb/pdb.c +++ b/libr/bin/pdb/pdb.c @@ -188,7 +188,7 @@ static int init_pdb7_root_stream(RPdb *pdb, int *root_page_list, int pages_amoun if ((pos + num_pages) > tmp_data_max_size) { R_FREE (data); R_FREE (sizes); - R_LOG_WARN ("looks like there is no correct values of stream size in PDB file."); + R_LOG_WARN ("looks like there is no correct values of stream size in PDB file"); return 0; } @@ -349,7 +349,7 @@ static int pdb_read_root(RPdb *pdb) { while (r_list_iter_next (it)) { page = (SPage *) r_list_iter_get (it); if (page->stream_pages == 0) { - //R_LOG_WARN ("no stream pages. Skipping."); + R_LOG_DEBUG ("no stream pages. Skipping"); r_list_append (pList, NULL); i++; continue; @@ -438,7 +438,7 @@ static bool pdb7_parse(RPdb *pdb) { bytes_read = r_buf_read (pdb->buf, (unsigned char *) signature, PDB7_SIGNATURE_LEN); if (bytes_read != PDB7_SIGNATURE_LEN) { - //R_LOG_ERROR ("Error while reading PDB7_SIGNATURE."); + //R_LOG_ERROR ("Error while reading PDB7_SIGNATURE"); goto error; } if (!read_int_var ("page_size", &page_size, pdb)) { @@ -465,14 +465,14 @@ static bool pdb7_parse(RPdb *pdb) { num_root_index_pages = count_pages ((num_root_pages * 4), page_size); root_index_pages = (int *) calloc (sizeof (int), R_MAX (num_root_index_pages, 1)); if (!root_index_pages) { - R_LOG_ERROR ("Error memory allocation."); + R_LOG_ERROR ("Error memory allocation"); goto error; } bytes_read = r_buf_read (pdb->buf, (unsigned char *) root_index_pages, 4 * num_root_index_pages); // fread(root_index_pages, 4, num_root_index_pages, pdb->fp); if (bytes_read != 4 * num_root_index_pages) { - R_LOG_ERROR ("Error while reading root_index_pages."); + R_LOG_ERROR ("Error while reading root_index_pages"); goto error; } if (page_size < 1 || num_root_index_pages < 1) { @@ -481,7 +481,7 @@ static bool pdb7_parse(RPdb *pdb) { } root_page_data = (int *) calloc (page_size, num_root_index_pages); if (!root_page_data) { - R_LOG_ERROR ("memory allocation of root_page_data."); + R_LOG_ERROR ("memory allocation of root_page_data"); goto error; } p_tmp = root_page_data; @@ -496,7 +496,7 @@ static bool pdb7_parse(RPdb *pdb) { } root_page_list = (int *) calloc (sizeof(int), num_root_pages); if (!root_page_list) { - R_LOG_ERROR ("memory allocation of root page."); + R_LOG_ERROR ("memory allocation of root page"); goto error; } diff --git a/libr/bp/bp.c b/libr/bp/bp.c index 0bd9ac53b2..dd8fea2685 100644 --- a/libr/bp/bp.c +++ b/libr/bp/bp.c @@ -161,7 +161,7 @@ static RBreakpointItem *r_bp_add(RBreakpoint *bp, const ut8 *obytes, ut64 addr, return NULL; } if (r_bp_get_in (bp, addr, perm)) { - R_LOG_WARN ("Breakpoint already set at this address."); + R_LOG_WARN ("Breakpoint already set at this address"); return NULL; } b = r_bp_item_new (bp); @@ -170,10 +170,10 @@ static RBreakpointItem *r_bp_add(RBreakpoint *bp, const ut8 *obytes, ut64 addr, } b->addr = addr + bp->delta; if (bp->baddr > addr) { - R_LOG_WARN ("base addr should not be larger than the breakpoint address."); + R_LOG_WARN ("base addr should not be larger than the breakpoint address"); } if (bp->bpinmaps && !r_bp_is_valid (bp, b)) { - R_LOG_WARN ("Cannot set breakpoint outside maps. Use dbg.bpinmaps to false."); + R_LOG_WARN ("Cannot set breakpoint outside maps. Use dbg.bpinmaps to false"); } b->delta = addr - bp->baddr; b->size = size; diff --git a/libr/cons/cons.c b/libr/cons/cons.c index f3f4098383..7de63b6384 100644 --- a/libr/cons/cons.c +++ b/libr/cons/cons.c @@ -1876,7 +1876,7 @@ R_API void r_cons_set_utf8(bool b) { r_sys_perror ("r_cons_set_utf8"); } } else { - R_LOG_WARN ("UTF-8 Codepage not installed."); + R_LOG_WARN ("UTF-8 Codepage not installed"); } } else { UINT acp = GetACP (); diff --git a/libr/cons/editor.c b/libr/cons/editor.c index 0ea560db5c..279efa3d7e 100644 --- a/libr/cons/editor.c +++ b/libr/cons/editor.c @@ -59,7 +59,7 @@ static void filesave(void) { } } if (!path) { - R_LOG_ERROR ("No file given."); + R_LOG_ERROR ("No file given"); return; } if (lines) { @@ -91,7 +91,7 @@ R_API char *r_cons_editor(const char *file, const char *str) { lines = r_file_slurp (file, &sz); bytes = (int)sz; if (!lines) { - R_LOG_ERROR ("Failed to load '%s'.", file); + R_LOG_ERROR ("Failed to load '%s'", file); R_FREE (path); return NULL; } diff --git a/libr/cons/hud.c b/libr/cons/hud.c index 49b672955b..367b933673 100644 --- a/libr/cons/hud.c +++ b/libr/cons/hud.c @@ -20,7 +20,7 @@ R_API char *r_cons_hud_file(const char *f) { // the lines starting with # ) R_API char *r_cons_hud_line_string(const char *s) { if (!r_cons_is_interactive ()) { - R_LOG_ERROR ("Hud mode requires scr.interactive=true."); + R_LOG_ERROR ("Hud mode requires scr.interactive=true"); return NULL; } char *os, *track, *ret, *o = strdup (s); @@ -59,7 +59,7 @@ R_API char *r_cons_hud_line_string(const char *s) { // the lines starting with # ) R_API char *r_cons_hud_string(const char *s) { if (!r_cons_is_interactive ()) { - R_LOG_ERROR ("Hud mode requires scr.interactive=true."); + R_LOG_ERROR ("Hud mode requires scr.interactive=true"); return NULL; } char *os, *track, *ret, *o = strdup (s); diff --git a/libr/cons/less.c b/libr/cons/less.c index 498f3493e6..28846c3eb0 100644 --- a/libr/cons/less.c +++ b/libr/cons/less.c @@ -19,7 +19,7 @@ static const char *r_cons_less_help = \ R_API int r_cons_less_str(const char *str, const char *exitkeys) { r_return_val_if_fail (str && *str, 0); if (!r_cons_is_interactive ()) { - R_LOG_ERROR ("Internal less requires scr.interactive=true."); + R_LOG_ERROR ("Internal less requires scr.interactive=true"); return 0; } diff --git a/libr/core/anal_tp.c b/libr/core/anal_tp.c index ce6e0338c1..598504ef78 100644 --- a/libr/core/anal_tp.c +++ b/libr/core/anal_tp.c @@ -583,7 +583,7 @@ repeat: for (j = 0; j < bblist_size; j++) { bb = r_anal_get_block_at (core->anal, bblist[j]); if (!bb) { - R_LOG_WARN ("basic block at 0x%08"PFMT64x" was removed during analysis.", bblist[j]); + R_LOG_WARN ("basic block at 0x%08"PFMT64x" was removed during analysis", bblist[j]); retries--; free (bblist); goto repeat; @@ -636,7 +636,7 @@ repeat: if (i < bblist_size) { bb = r_anal_get_block_at (core->anal, bb_addr); if (!bb) { - R_LOG_WARN ("basic block at 0x%08"PFMT64x" was removed during analysis.", bblist[i]); + R_LOG_WARN ("basic block at 0x%08"PFMT64x" was removed during analysis", bblist[i]); retries--; free (bblist); goto repeat; diff --git a/libr/core/canal.c b/libr/core/canal.c index 59bcbf0fdc..fabe6f21d9 100644 --- a/libr/core/canal.c +++ b/libr/core/canal.c @@ -997,7 +997,7 @@ R_API RAnalOp* r_core_anal_op(RCore *core, ut64 addr, int mask) { if (!op->mnemonic && mask & R_ANAL_OP_MASK_DISASM) { RAsmOp asmop; if (core->anal->verbose) { - R_LOG_WARN ("Implement RAnalOp.MASK_DISASM for current anal.arch. Using the sluggish RAsmOp fallback for now."); + R_LOG_WARN ("Implement RAnalOp.MASK_DISASM for current anal.arch. Using the sluggish RAsmOp fallback for now"); } r_asm_set_pc (core->rasm, addr); r_asm_op_init (&asmop); @@ -5234,7 +5234,7 @@ R_API void r_core_anal_esil(RCore *core, const char *str, const char *target) { return; } if (iend > MAX_SCAN_SIZE) { - R_LOG_WARN ("Not going to analyze 0x%08"PFMT64x" bytes.", (ut64)iend); + R_LOG_WARN ("Not going to analyze 0x%08"PFMT64x" bytes", (ut64)iend); return; } buf = malloc ((size_t)iend + 2); @@ -5256,7 +5256,7 @@ R_API void r_core_anal_esil(RCore *core, const char *str, const char *target) { } const char *kspname = r_reg_get_name (core->anal->reg, R_REG_NAME_SP); if (R_STR_ISEMPTY (kspname)) { - R_LOG_ERROR ("No =SP defined in the reg profile."); + R_LOG_ERROR ("No =SP defined in the reg profile"); return; } char *spname = strdup (kspname); @@ -5415,7 +5415,7 @@ R_API void r_core_anal_esil(RCore *core, const char *str, const char *target) { } const char *sn = r_reg_get_name (core->anal->reg, R_REG_NAME_SN); if (!sn) { - R_LOG_WARN ("No SN reg alias for current architecture."); + R_LOG_WARN ("No SN reg alias for current architecture"); } if (sn && op.type == R_ANAL_OP_TYPE_SWI) { r_strf_buffer (64); diff --git a/libr/core/cbin.c b/libr/core/cbin.c index 18e868c26d..d2968fa64c 100644 --- a/libr/core/cbin.c +++ b/libr/core/cbin.c @@ -781,11 +781,11 @@ R_API void r_core_anal_cc_init(RCore *core) { char *s = r_reg_profile_to_cc (core->anal->reg); if (s) { if (!r_anal_cc_set (core->anal, s)) { - R_LOG_WARN ("Invalid CC from reg profile."); + R_LOG_WARN ("Invalid CC from reg profile"); } free (s); } else { - R_LOG_WARN ("Cannot derive CC from reg profile."); + R_LOG_WARN ("Cannot derive CC from reg profile"); } } #else @@ -808,11 +808,11 @@ R_API void r_core_anal_cc_init(RCore *core) { char *s = r_reg_profile_to_cc (core->anal->reg); if (s) { if (!r_anal_cc_set (core->anal, s)) { - R_LOG_WARN ("Invalid CC from reg profile."); + R_LOG_WARN ("Invalid CC from reg profile"); } free (s); } else { - R_LOG_WARN ("Cannot derive CC from reg profile."); + R_LOG_WARN ("Cannot derive CC from reg profile"); } } R_FREE (cc->path); @@ -825,7 +825,7 @@ R_API void r_core_anal_cc_init(RCore *core) { cc->path = strdup (dbpath); } if (anal_arch && sdb_isempty (core->anal->sdb_cc)) { - R_LOG_WARN ("Missing calling conventions for '%s' %d. Deriving it from the regprofile.", anal_arch, bits); + R_LOG_WARN ("Missing calling conventions for '%s' %d. Deriving it from the regprofile", anal_arch, bits); } free (anal_arch); free (dbpath); diff --git a/libr/core/cconfig.c b/libr/core/cconfig.c index deddec2954..fe78b3de41 100644 --- a/libr/core/cconfig.c +++ b/libr/core/cconfig.c @@ -1355,7 +1355,7 @@ static bool cb_cfgcharset(void *user, void *data) { if (rc) { r_sys_setenv ("RABIN2_CHARSET", cf); } else { - R_LOG_WARN ("Cannot load charset file '%s'.", cf); + R_LOG_WARN ("Cannot load charset file '%s'", cf); } } return rc; @@ -1746,7 +1746,7 @@ static bool cb_dbg_execs(void *user, void *data) { } #else if (node->i_value) { - R_LOG_WARN ("dbg.execs is not supported in this platform."); + R_LOG_WARN ("dbg.execs is not supported in this platform"); } #endif return true; @@ -2287,7 +2287,7 @@ static bool cb_io_pava(void *user, void *data) { RConfigNode *node = (RConfigNode *) data; core->print->pava = node->i_value; if (node->i_value && core->io->va) { - R_LOG_WARN ("You may probably want to disable io.va too."); + R_LOG_WARN ("You may probably want to disable io.va too"); } return true; } @@ -3292,7 +3292,7 @@ static bool cb_prjvctype(void *user, void *data) { if (!strcmp (node->value, "rvc")) { return true; } - R_LOG_ERROR ("Unknown version control '%s'.", node->value); + R_LOG_ERROR ("Unknown version control '%s'", node->value); return false; } diff --git a/libr/core/cfile.c b/libr/core/cfile.c index 301287b524..ded697315d 100644 --- a/libr/core/cfile.c +++ b/libr/core/cfile.c @@ -438,7 +438,7 @@ static int r_core_file_do_load_for_io_plugin(RCore *r, ut64 baseaddr, ut64 loada binfile = r_bin_cur (r->bin); if (r_core_bin_set_env (r, binfile)) { if (r->anal->verbose && !sdb_const_get (r->anal->sdb_cc, "default.cc", 0)) { - R_LOG_WARN ("No calling convention defined for this file, analysis may be inaccurate."); + R_LOG_WARN ("No calling convention defined for this file, analysis may be inaccurate"); } } plugin = r_bin_file_cur_plugin (binfile); @@ -725,7 +725,7 @@ R_API bool r_core_bin_load(RCore *r, const char *filenameuri, ut64 baddr) { } r_core_cmd0 (r, "obb 0;s entry0"); r_config_set_i (r->config, "bin.at", true); - R_LOG_INFO ("[bin.libs] Linking imports..."); + R_LOG_INFO ("[bin.libs] Linking imports"); RBinImport *imp; const RList *imports = r_bin_get_imports (r->bin); r_list_foreach (imports, iter, imp) { diff --git a/libr/core/cmd.c b/libr/core/cmd.c index a7b749f9a3..abf2abff15 100644 --- a/libr/core/cmd.c +++ b/libr/core/cmd.c @@ -1674,7 +1674,7 @@ static void load_table_asciiart(RCore *core, RTable *t, RList *lines) { RListIter *iter2; ncols = 0; if (r_list_length (t->cols) > 0) { - R_LOG_WARN ("Not re-adding headers. Use ,- to reset the table."); + R_LOG_WARN ("Not re-adding headers. Use ,- to reset the table"); continue; } r_list_foreach (args, iter2, arg) { @@ -5436,7 +5436,7 @@ static int run_cmd_depth(RCore *core, char *cmd) { int ret = false; if (core->cons->context->cmd_depth < 1) { - R_LOG_ERROR ("That '%s' was too deep...", cmd); + R_LOG_ERROR ("That '%s' was too deep", cmd); return false; } core->cons->context->cmd_depth--; diff --git a/libr/core/cmd_anal.c b/libr/core/cmd_anal.c index cd84415d6a..ce9c0e4a03 100644 --- a/libr/core/cmd_anal.c +++ b/libr/core/cmd_anal.c @@ -1194,7 +1194,7 @@ static bool cmd_anal_aaft(RCore *core) { const char *io_cache_key = "io.pcache.write"; bool io_cache = r_config_get_b (core->config, io_cache_key); if (r_config_get_b (core->config, "cfg.debug")) { - R_LOG_WARN ("aaft is disabled in debugger mode."); + R_LOG_WARN ("aaft is disabled in debugger mode"); return false; } if (!io_cache) { @@ -1264,7 +1264,7 @@ static void find_refs(RCore *core, const char *glob) { eprintf ("Usage: axF [flag-str-filter]\n"); return; } - R_LOG_WARN ("Finding references of flags matching '%s'...", glob); + R_LOG_WARN ("Finding references of flags matching '%s'", glob); char *cmd = r_str_newf (".(findstref) @@=`f~%s[0]`", glob); r_core_cmd0 (core, "(findstref;f here=$$;s entry0;/r here;f-here)"); r_core_cmd0 (core, cmd); @@ -2380,7 +2380,7 @@ static void core_anal_bytes(RCore *core, const ut8 *buf, int len, int nops, int r_anal_esil_stack_free (esil); esil = NULL; } else { - R_LOG_ERROR ("ESIL is not initialized. Run `aei`."); + R_LOG_ERROR ("ESIL is not initialized. Run `aei`"); break; } } else { @@ -7514,11 +7514,11 @@ static void cmd_anal_esil(RCore *core, const char *input, bool verbose) { switch (input[2]) { case '+': // "aets+" if (!esil) { - R_LOG_ERROR ("ESIL is not initialized. Use `aeim` first."); + R_LOG_ERROR ("ESIL is not initialized. Use `aeim` first"); break; } if (esil->trace) { - eprintf ("ESIL trace already started\n"); + R_LOG_INFO ("ESIL trace already started"); break; } esil->trace = r_anal_esil_trace_new (esil); @@ -7529,7 +7529,7 @@ static void cmd_anal_esil(RCore *core, const char *input, bool verbose) { break; case '-': // "aets-" if (!esil) { - R_LOG_ERROR ("ESIL is not initialized. Use `aeim` first."); + R_LOG_ERROR ("ESIL is not initialized. Use `aeim` first"); break; } if (!esil->trace) { @@ -11715,9 +11715,9 @@ static void cmd_anal_class_method(RCore *core, const char *input) { end = strchr (name_str, ' '); if (!end) { if (c == ' ') { - R_LOG_ERROR ("No offset given."); + R_LOG_ERROR ("No offset given"); } else if (c == 'n') { - R_LOG_ERROR ("No new method name given."); + R_LOG_ERROR ("No new method name given"); } free (cstr); break; diff --git a/libr/core/cmd_type.c b/libr/core/cmd_type.c index 1d4e72c193..07448f989d 100644 --- a/libr/core/cmd_type.c +++ b/libr/core/cmd_type.c @@ -269,7 +269,7 @@ static void cmd_tcc(RCore *core, const char *input) { case ' ': if (strchr (input, '(')) { if (!r_anal_cc_set (core->anal, input + 1)) { - R_LOG_ERROR ("Invalid syntax in cc signature."); + R_LOG_ERROR ("Invalid syntax in cc signature"); } } else { const char *ccname = r_str_trim_head_ro (input + 1); diff --git a/libr/core/p/core_java.c b/libr/core/p/core_java.c index d2d1c1e508..9ff85407f8 100644 --- a/libr/core/p/core_java.c +++ b/libr/core/p/core_java.c @@ -874,7 +874,7 @@ static int r_cmd_java_handle_replace_classname_value(RCore *core, const char *cm core, obj, idx, addr, (const ut8 *)result, res_len); if (res == false) { - R_LOG_ERROR ("ERROR: r_cmd_java: Failed to write bytes or reload the binary."); + R_LOG_ERROR ("ERROR: r_cmd_java: Failed to write bytes or reload the binary"); } } free (result); @@ -1433,7 +1433,7 @@ static int r_cmd_java_handle_set_flags(RCore *core, const char *input) { default: flag_value = -1; } } - IFDBG r_cons_printf ("Current args: (flag_value: 0x%04x addr: 0x%" PFMT64x ")\n.", flag_value, addr); + IFDBG r_cons_printf ("Current args: (flag_value: 0x%04x addr: 0x%" PFMT64x ")\n", flag_value, addr); if (flag_value != -1) { res = r_cmd_java_set_acc_flags (core, addr, ((ut16)flag_value) & 0xffff); IFDBG r_cons_printf ("Writing 0x%04x to 0x%" PFMT64x ": %d.", flag_value, addr, res); @@ -1739,7 +1739,7 @@ static int r_cmd_java_print_method_num_name(RBinJavaObj *obj) { static int r_cmd_java_print_field_summary(RBinJavaObj *obj, ut16 idx) { int res = r_bin_java_print_field_idx_summary (obj, idx); if (res == false) { - R_LOG_ERROR ("Field or Method @ index (%d) not found in the RBinJavaObj.", idx); + R_LOG_ERROR ("Field or Method @ index (%d) not found in the RBinJavaObj", idx); res = true; } return res; @@ -1757,7 +1757,7 @@ static int r_cmd_java_print_field_name(RBinJavaObj *obj, ut16 idx) { if (res) { r_cons_println (res); } else { - R_LOG_ERROR ("Field or Method @ index (%d) not found in the RBinJavaObj.", idx); + R_LOG_ERROR ("Field or Method @ index (%d) not found in the RBinJavaObj", idx); } free (res); return true; @@ -1766,7 +1766,7 @@ static int r_cmd_java_print_field_name(RBinJavaObj *obj, ut16 idx) { static int r_cmd_java_print_method_summary(RBinJavaObj *obj, ut16 idx) { int res = r_bin_java_print_method_idx_summary (obj, idx); if (res == false) { - R_LOG_ERROR ("Field or Method @ index (%d) not found in the RBinJavaObj.", idx); + R_LOG_ERROR ("Field or Method @ index (%d) not found in the RBinJavaObj", idx); res = true; } return res; @@ -1784,7 +1784,7 @@ static int r_cmd_java_print_method_name(RBinJavaObj *obj, ut16 idx) { if (res) { r_cons_println (res); } else { - R_LOG_ERROR ("Field or Method @ index (%d) not found in the RBinJavaObj.", idx); + R_LOG_ERROR ("Field or Method @ index (%d) not found in the RBinJavaObj", idx); } free (res); return true; diff --git a/libr/core/rtr.c b/libr/core/rtr.c index b8bfa43a07..c07c0313c0 100644 --- a/libr/core/rtr.c +++ b/libr/core/rtr.c @@ -678,20 +678,20 @@ R_API void r_core_rtr_pushout(RCore *core, const char *input) { switch (rtr_host[rtr_n].proto) { case RTR_PROTOCOL_RAP: - R_LOG_ERROR ("Cannot use '=<' to a rap connection."); + R_LOG_ERROR ("Cannot use '=<' to a rap connection"); break; case RTR_PROTOCOL_UNIX: r_socket_write (rtr_host[rtr_n].fd, str, strlen (str)); break; case RTR_PROTOCOL_HTTP: - eprintf ("TODO\n"); + R_LOG_INFO ("TODO"); break; case RTR_PROTOCOL_TCP: case RTR_PROTOCOL_UDP: r_socket_write (rtr_host[rtr_n].fd, str, strlen (str)); break; default: - eprintf ("Unknown protocol\n"); + R_LOG_ERROR ("Unknown protocol"); break; } free (str); diff --git a/libr/core/windows_heap.c b/libr/core/windows_heap.c index 4b93e6dcd9..9219b92169 100644 --- a/libr/core/windows_heap.c +++ b/libr/core/windows_heap.c @@ -341,7 +341,7 @@ static bool GetLFHKey(RDebug *dbg, HANDLE h_proc, bool segment, WPARAM *lfhKey) } if (!ReadProcessMemory (h_proc, (PVOID)lfhKeyLocation, lfhKey, sizeof (WPARAM), NULL)) { r_sys_perror ("ReadProcessMemory"); - R_LOG_WARN ("LFH key not found."); + R_LOG_WARN ("LFH key not found"); *lfhKey = 0; return false; } @@ -740,7 +740,7 @@ static PDEBUG_BUFFER GetHeapBlocks(DWORD pid, RDebug *dbg) { if (!GetLFHKey (dbg, h_proc, false, &lfhKey)) { RtlDestroyQueryDebugBuffer (db); CloseHandle (h_proc); - R_LOG_ERROR ("GetHeapBlocks: Failed to get LFH key."); + R_LOG_ERROR ("GetHeapBlocks: Failed to get LFH key"); return NULL; } @@ -954,12 +954,12 @@ static PHeapBlock GetSingleSegmentBlock(RDebug *dbg, HANDLE h_proc, PSEGMENT_HEA */ PHeapBlock hb = R_NEW0 (HeapBlock); if (!hb) { - R_LOG_ERROR ("GetSingleSegmentBlock: Allocation failed."); + R_LOG_ERROR ("GetSingleSegmentBlock: Allocation failed"); return NULL; } PHeapBlockExtraInfo extra = R_NEW0 (HeapBlockExtraInfo); if (!extra) { - R_LOG_ERROR ("GetSingleSegmentBlock: Allocation failed."); + R_LOG_ERROR ("GetSingleSegmentBlock: Allocation failed"); goto err; } hb->extraInfo = extra; @@ -1058,7 +1058,7 @@ static PHeapBlock GetSingleBlock(RDebug *dbg, ut64 offset) { PHeapBlockExtraInfo extra = NULL; if (!hb) { - R_LOG_ERROR ("GetSingleBlock: Allocation failed."); + R_LOG_ERROR ("GetSingleBlock: Allocation failed"); return NULL; } HANDLE h_proc = OpenProcess (PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, dbg->pid); @@ -1072,7 +1072,7 @@ static PHeapBlock GetSingleBlock(RDebug *dbg, ut64 offset) { } extra = R_NEW0 (HeapBlockExtraInfo); if (!extra) { - R_LOG_ERROR ("GetSingleBlock: Allocation failed."); + R_LOG_ERROR ("GetSingleBlock: Allocation failed"); goto err; } WPARAM NtLFHKey; @@ -1185,7 +1185,7 @@ static void w32_list_heaps(RCore *core, const char format) { db = GetHeapBlocks (pid, core->dbg); } if (!db) { - R_LOG_WARN ("Couldn't get heap info."); + R_LOG_WARN ("Couldn't get heap info"); return; } } @@ -1239,7 +1239,7 @@ static void w32_list_heaps_blocks(RCore *core, const char format) { db = InitHeapInfo (core->dbg, PDI_HEAPS | PDI_HEAP_BLOCKS); } if (!db) { - R_LOG_ERROR ("Couldn't get heap info."); + R_LOG_ERROR ("Couldn't get heap info"); return; } PHeapInformation heapInfo = db->HeapInformation; diff --git a/libr/debug/dsession.c b/libr/debug/dsession.c index 0bcfb73aa1..801e548c9c 100644 --- a/libr/debug/dsession.c +++ b/libr/debug/dsession.c @@ -220,7 +220,7 @@ R_API bool r_debug_session_add_reg_change(RDebugSession *session, int arena, ut6 if (!vreg) { vreg = r_vector_new (sizeof (RDebugChangeReg), NULL, NULL); if (!vreg) { - R_LOG_ERROR ("creating a register vector."); + R_LOG_ERROR ("creating a register vector"); return false; } ht_up_insert (session->registers, offset | (arena << 16), vreg); @@ -235,7 +235,7 @@ R_API bool r_debug_session_add_mem_change(RDebugSession *session, ut64 addr, ut8 if (!vmem) { vmem = r_vector_new (sizeof (RDebugChangeMem), NULL, NULL); if (!vmem) { - R_LOG_ERROR ("creating a memory vector."); + R_LOG_ERROR ("creating a memory vector"); return false; } ht_up_insert (session->memory, addr, vmem); @@ -481,7 +481,7 @@ static bool deserialize_memory_cb(void *user, const char *addr, const char *v) { // Insert a new vector into `memory` HtUP at `addr` RVector *vmem = r_vector_new (sizeof (RDebugChangeMem), NULL, NULL); if (!vmem) { - R_LOG_ERROR ("failed to allocate RVector vmem."); + R_LOG_ERROR ("failed to allocate RVector vmem"); free (json_str); r_json_free (reg_json); return false; @@ -530,7 +530,7 @@ static bool deserialize_registers_cb(void *user, const char *addr, const char *v HtUP *registers = user; RVector *vreg = r_vector_new (sizeof (RDebugChangeReg), NULL, NULL); if (!vreg) { - R_LOG_ERROR ("failed to allocate RVector vreg."); + R_LOG_ERROR ("failed to allocate RVector vreg"); r_json_free (reg_json); free (json_str); return true; diff --git a/libr/debug/p/debug_gdb.c b/libr/debug/p/debug_gdb.c index 70b5c9a61a..3fc8abe089 100644 --- a/libr/debug/p/debug_gdb.c +++ b/libr/debug/p/debug_gdb.c @@ -373,7 +373,7 @@ static bool r_debug_gdb_attach(RDebug *dbg, int pid) { int bits = dbg->anal->config->bits; gdbr_set_architecture (desc, arch, bits); } else { - R_LOG_ERROR ("ERROR: Underlying IO descriptor is not a GDB one.."); + R_LOG_ERROR ("ERROR: Underlying IO descriptor is not a GDB one"); } } return true; diff --git a/libr/debug/p/debug_native.c b/libr/debug/p/debug_native.c index cefc1a91ee..d59c1de474 100644 --- a/libr/debug/p/debug_native.c +++ b/libr/debug/p/debug_native.c @@ -239,7 +239,7 @@ static bool r_debug_native_continue(RDebug *dbg, int pid, int tid, int sig) { r_list_foreach (dbg->threads, it, th) { ret = r_debug_ptrace (dbg, PTRACE_CONT, th->pid, 0, 0); if (ret) { - R_LOG_ERROR ("(%d) is running or dead.", th->pid); + R_LOG_ERROR ("(%d) is running or dead", th->pid); } } } else { @@ -1587,7 +1587,7 @@ static int r_debug_setup_ownership(int fd, RDebug *dbg) { RDebugInfo *info = r_debug_info (dbg, NULL); if (!info) { - R_LOG_ERROR ("Error while getting debug info."); + R_LOG_ERROR ("Error while getting debug info"); return -1; } fchown (fd, info->uid, info->gid); diff --git a/libr/debug/p/debug_rap.c b/libr/debug/p/debug_rap.c index dd9f56fe08..f9621fa72e 100644 --- a/libr/debug/p/debug_rap.c +++ b/libr/debug/p/debug_rap.c @@ -35,7 +35,7 @@ static bool __rap_attach(RDebug *dbg, int pid) { if (!strcmp ("rap", d->plugin->name)) { eprintf ("SUCCESS: rap attach with inferior rap rio worked\n"); } else { - R_LOG_ERROR ("ERROR: Underlying IO descriptor is not a rap one.."); + R_LOG_ERROR ("ERROR: Underlying IO descriptor is not a rap one"); } } return true; diff --git a/libr/debug/p/native/windows/windows_debug.c b/libr/debug/p/native/windows/windows_debug.c index 9d2db21f58..6f31778625 100644 --- a/libr/debug/p/native/windows/windows_debug.c +++ b/libr/debug/p/native/windows/windows_debug.c @@ -48,7 +48,6 @@ static PTHREAD_ITEM __r_debug_thread_add(RDebug *dbg, DWORD pid, DWORD tid, HAND } pthread = R_NEW0 (THREAD_ITEM); if (!pthread) { - R_LOG_ERROR ("__r_debug_thread_add: Memory allocation failed."); return NULL; } *pthread = th; diff --git a/libr/debug/snap.c b/libr/debug/snap.c index c216821559..7055a3e0d0 100644 --- a/libr/debug/snap.c +++ b/libr/debug/snap.c @@ -44,7 +44,7 @@ R_API RDebugSnap *r_debug_snap_map(RDebug *dbg, RDebugMap *map) { r_debug_snap_free (snap); return NULL; } - R_LOG_ERROR ("Reading %d byte(s) from 0x%08"PFMT64x "...", snap->size, snap->addr); + R_LOG_ERROR ("Reading %d byte(s) from 0x%08"PFMT64x, snap->size, snap->addr); dbg->iob.read_at (dbg->iob.io, snap->addr, snap->data, snap->size); return snap; diff --git a/libr/debug/trace.c b/libr/debug/trace.c index 788e8b6358..b9485ce6b3 100644 --- a/libr/debug/trace.c +++ b/libr/debug/trace.c @@ -76,7 +76,7 @@ R_API bool r_debug_trace_ins_before(RDebug *dbg) { break; case R_ANAL_VAL_MEM: if (val->memref > 32) { - R_LOG_ERROR ("adding changes to %d bytes in memory.", val->memref); + R_LOG_ERROR ("adding changes to %d bytes in memory", val->memref); r_list_delete (dbg->cur_op->access, it); break; } diff --git a/libr/egg/egg.c b/libr/egg/egg.c index e18b9c7707..4661b761b6 100644 --- a/libr/egg/egg.c +++ b/libr/egg/egg.c @@ -372,7 +372,7 @@ R_API bool r_egg_compile(REgg *egg) { for (; b; ) { r_egg_lang_parsechar (egg, b); if (egg->lang.elem_n >= sizeof (egg->lang.elem)) { - R_LOG_ERROR ("ERROR: elem too large."); + R_LOG_ERROR ("too large element"); break; } size_t r = r_buf_read (egg->src, (ut8 *)&b, sizeof (b)); @@ -382,7 +382,7 @@ R_API bool r_egg_compile(REgg *egg) { // XXX: some parse fail errors are false positives :( } if (egg->context > 0) { - R_LOG_ERROR ("ERROR: expected '}' at the end of the file. %d left", egg->context); + R_LOG_ERROR ("expected '}' at the end of the file. %d left", egg->context); return false; } // TODO: handle errors here diff --git a/libr/io/p/io_debug.c b/libr/io/p/io_debug.c index b5fdca53b5..524087ee99 100644 --- a/libr/io/p/io_debug.c +++ b/libr/io/p/io_debug.c @@ -177,7 +177,7 @@ static int fork_and_ptraceme(RIO *io, int bits, const char *cmd) { return pid; err_fork: - R_LOG_ERROR ("Cannot create new process."); + R_LOG_ERROR ("Cannot create new process"); TerminateProcess (pi.hProcess, 1); r_w32dw_free (io->dbgwrap); io->dbgwrap = NULL; @@ -257,7 +257,7 @@ static RRunProfile* _get_run_profile(RIO *io, int bits, char **argv) { rp->_dodebug = true; if (io->runprofile && *io->runprofile) { if (!r_run_parsefile (rp, io->runprofile)) { - eprintf ("Can't find profile '%s'\n", io->runprofile); + R_LOG_ERROR ("Can't find profile '%s'", io->runprofile); r_run_free (rp); return NULL; } @@ -266,19 +266,19 @@ static RRunProfile* _get_run_profile(RIO *io, int bits, char **argv) { } } else if (io->envprofile) { if (!r_run_parse (rp, io->envprofile)) { - eprintf ("Can't parse default rarun2 profile\n"); + R_LOG_ERROR ("Can't parse default rarun2 profile"); r_run_free (rp); return NULL; } } if (bits == 64) { - r_run_parseline (rp, expr=strdup ("bits=64")); + r_run_parseline (rp, expr = strdup ("bits=64")); } else if (bits == 32) { - r_run_parseline (rp, expr=strdup ("bits=32")); + r_run_parseline (rp, expr = strdup ("bits=32")); } free (expr); if (r_run_config_env (rp)) { - eprintf ("Can't config the environment.\n"); + R_LOG_ERROR ("Cannot configure the environment"); r_run_free (rp); return NULL; } diff --git a/libr/io/p/io_self.c b/libr/io/p/io_self.c index 17d0cb714e..5cfdb5a886 100644 --- a/libr/io/p/io_self.c +++ b/libr/io/p/io_self.c @@ -226,7 +226,7 @@ static int update_self_regions(RIO *io, int pid) { HANDLE h = OpenProcess (PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 0, pid); LPTSTR name = calloc (name_size, sizeof (TCHAR)); if (!name) { - R_LOG_ERROR ("io_self/update_self_regions: Failed to allocate memory."); + R_LOG_ERROR ("io_self/update_self_regions: Failed to allocate memory"); CloseHandle (h); return false; } diff --git a/libr/io/p/io_zip.c b/libr/io/p/io_zip.c index d451c05c9d..3532f4c059 100644 --- a/libr/io/p/io_zip.c +++ b/libr/io/p/io_zip.c @@ -321,7 +321,7 @@ static RList *r_io_zip_open_many(RIO *io, const char *file, int rw, int mode) { filename_in_zipfile, ZIP_CREATE, mode, rw); if (zfo && zfo->entry == -1) { - R_LOG_WARN ("File did not exist, creating a new one."); + R_LOG_WARN ("File did not exist, creating a new one"); } if (zfo) { zfo->io_backref = io; @@ -499,7 +499,7 @@ static RIODesc *r_io_zip_open(RIO *io, const char *file, int rw, int mode) { RIOZipFileObj *zfo = r_io_zip_alloc_zipfileobj (zip_filename, filename_in_zipfile, ZIP_CREATE, mode, rw); if (zfo) { if (zfo->entry == -1) { - R_LOG_WARN ("File did not exist, creating a new one."); + R_LOG_WARN ("File did not exist, creating a new one"); } zfo->io_backref = io; res = r_io_desc_new (io, &r_io_plugin_zip, zfo->name, rw, mode, zfo); diff --git a/libr/main/radare2.c b/libr/main/radare2.c index 2dd79c0ddd..151570aa9d 100644 --- a/libr/main/radare2.c +++ b/libr/main/radare2.c @@ -1000,7 +1000,7 @@ R_API int r_main_radare2(int argc, const char **argv) { if (pfile && r_file_is_directory (pfile)) { if (debug) { - R_LOG_ERROR ("Cannot debug directories, yet."); + R_LOG_ERROR ("Cannot debug directories, yet"); LISTS_FREE (); free (pfile); R_FREE (debugbackend); diff --git a/libr/reg/profile.c b/libr/reg/profile.c index 2f7aea73bb..fd65b391d9 100644 --- a/libr/reg/profile.c +++ b/libr/reg/profile.c @@ -56,7 +56,7 @@ static const char *parse_def(RReg *reg, char **tok, const int n) { return "Invalid register type"; } if (r_reg_get (reg, tok[1], R_REG_TYPE_ALL)) { - R_LOG_WARN ("Duplicated register definition for '%s' has been ignored.", tok[1]); + R_LOG_WARN ("Duplicated register definition for '%s' has been ignored", tok[1]); return NULL; } diff --git a/libr/socket/run.c b/libr/socket/run.c index dea732917b..11bfe9a67e 100644 --- a/libr/socket/run.c +++ b/libr/socket/run.c @@ -79,7 +79,7 @@ static void dyn_init(void) { if (!(dyn_openpty && dyn_login_tty && dyn_forkpty)) { void *libutil; if (!(libutil = r_lib_dl_open ("libutil." R_LIB_EXT))) { - eprintf ("[ERROR] rarun2: Could not find PTY utils, failed to load %s\n", "libutil." R_LIB_EXT); + R_LOG_ERROR ("rarun2: Could not find PTY utils, failed to load libutil" R_LIB_EXT); return; } if (!dyn_openpty) { @@ -1242,7 +1242,7 @@ R_API int r_run_start(RRunProfile *p) { #endif } else { if (p->_pidfile) { - R_LOG_WARN ("pidfile doesnt work with 'system'."); + R_LOG_WARN ("pidfile doesnt work with 'system'"); } rc = r_sys_cmd (p->_system); } diff --git a/libr/socket/socket.c b/libr/socket/socket.c index 5de58db761..006bfcd700 100644 --- a/libr/socket/socket.c +++ b/libr/socket/socket.c @@ -260,7 +260,7 @@ R_API bool r_socket_connect(RSocket *s, const char *host, const char *port, int WSADATA wsadata; if (WSAStartup (MAKEWORD (1, 1), &wsadata) == SOCKET_ERROR) { - R_LOG_ERROR ("Error creating socket."); + R_LOG_ERROR ("WSAStartup failed"); return false; } #endif @@ -551,7 +551,7 @@ R_API bool r_socket_listen(RSocket *s, const char *port, const char *certfile) { #if __WINDOWS__ WSADATA wsadata; if (WSAStartup (MAKEWORD (1, 1), &wsadata) == SOCKET_ERROR) { - R_LOG_ERROR ("Error creating socket."); + R_LOG_ERROR ("WSAStartup failed"); return false; } #endif diff --git a/libr/util/file.c b/libr/util/file.c index dd4cba4429..19a1261763 100644 --- a/libr/util/file.c +++ b/libr/util/file.c @@ -254,8 +254,7 @@ R_API char *r_file_abspath_rel(const char *cwd, const char *file) { PTCHAR f = r_sys_conv_utf8_to_win (file); int s = GetFullPathName (f, MAX_PATH, abspath, NULL); if (s > MAX_PATH) { - // R_LOG_ERROR ("r_file_abspath/GetFullPathName: Path to file too long."); - eprintf ("r_file_abspath/GetFullPathName: Path to file too long.\n"); + eprintf ("r_file_abspath/GetFullPathName: Path to file too long\n"); } else if (!s) { r_sys_perror ("r_file_abspath/GetFullPathName"); } else { diff --git a/libr/util/punycode.c b/libr/util/punycode.c index 7303bfee2b..46681a0622 100644 --- a/libr/util/punycode.c +++ b/libr/util/punycode.c @@ -21,7 +21,7 @@ int utf32len (ut32 *input) { ut8 *utf32toutf8 (ut32 *input) { if (!input) { - R_LOG_ERROR ("ERROR input is null"); + R_LOG_ERROR ("input is null"); return NULL; } @@ -30,7 +30,6 @@ ut8 *utf32toutf8 (ut32 *input) { int len = utf32len (input); ut8 *result = calloc (4, len + 1); if (!result) { - R_LOG_ERROR ("ERROR: out of memory"); return NULL; } @@ -54,7 +53,7 @@ ut8 *utf32toutf8 (ut32 *input) { result[j] = 0xf0 | ((input[i] >> 18) & 0x7); j += 4; } else { - R_LOG_ERROR ("ERROR in toutf8. Seems like input is invalid"); + R_LOG_ERROR ("toutf8: invalid input"); free (result); return NULL; } @@ -66,7 +65,6 @@ ut8 *utf32toutf8 (ut32 *input) { ut32 *utf8toutf32 (const ut8 *input) { if (!input) { - R_LOG_ERROR ("ERROR input is null"); return NULL; } @@ -77,7 +75,6 @@ ut32 *utf8toutf32 (const ut8 *input) { ut32 *result = calloc (strlen ((const char *) input) + 1, 4); if (!result) { - R_LOG_ERROR ("ERROR: out of memory"); return NULL; } @@ -101,7 +98,7 @@ ut32 *utf8toutf32 (const ut8 *input) { (input[i + 3] & 0x3f); i += 4; } else { - R_LOG_ERROR ("ERROR in toutf32. Seems like input is invalid."); + R_LOG_ERROR ("toutf32: invalid input"); free (result); return NULL; } @@ -354,7 +351,7 @@ R_API char *r_punycode_decode(const char *src, int srclen, int *dstlen) { if (finaldst) { *dstlen = strlen ((const char *) finaldst); } else { - R_LOG_ERROR ("ERROR: finaldst is null"); + R_LOG_ERROR ("finaldst can't be null"); return NULL; } return (char *) finaldst; diff --git a/libr/util/str.c b/libr/util/str.c index 027747426c..2346283e4f 100644 --- a/libr/util/str.c +++ b/libr/util/str.c @@ -1188,7 +1188,7 @@ R_API int r_str_unescape(char *buf) { err |= r_hex_to_byte (&ch, buf[i + 2]); err |= r_hex_to_byte (&ch2, buf[i + 3]); if (err) { - R_LOG_ERROR ("Non-hexadecimal chars in input."); + R_LOG_ERROR ("Non-hexadecimal chars in input"); return 0; // -1? } buf[i] = (ch << 4) + ch2; diff --git a/sys/lint.sh b/sys/lint.sh index 91175c3de7..abfc2b534c 100755 --- a/sys/lint.sh +++ b/sys/lint.sh @@ -13,6 +13,7 @@ (git grep '4d""' libr) && exit 1 (git grep 'r_core_cmd' libr | grep -v /lang/ | grep '\\n') && exit 1 (git grep 'r_str_startswith ("' libr ) && exit 1 +(git grep R_LOG | grep '\."' | grep -v sys/) && exit 1 # pending cleanups # git grep -e "`printf '\x09static'`" libr | grep -v R_TH_LOCAL|grep -v const | grep -v '(' && exit 1 diff --git a/test/db/cmd/cmd_interactive_modes b/test/db/cmd/cmd_interactive_modes index 725ed41c89..91eca54631 100644 --- a/test/db/cmd/cmd_interactive_modes +++ b/test/db/cmd/cmd_interactive_modes @@ -5,7 +5,7 @@ e scr.interactive=false pd 1~.. EOF EXPECT_ERR=<