Ticket #3589: hex.patch
File hex.patch, 1.2 KB (added by phelum, 9 years ago) |
---|
-
hex.c
old new 73 73 74 74 while (loop < tmp_str_len) 75 75 { 76 unsigned int val; 77 int ptr; 76 int val, ptr; 78 77 79 78 /* cppcheck-suppress invalidscanf */ 80 79 if (sscanf (tmp_str + loop, "%x%n", &val, &ptr)) 81 80 { 82 if (val > 255)81 if (val < -128 || val > 255) 83 82 loop++; 84 83 else 85 84 { … … 100 99 loop2++; 101 100 } 102 101 103 // g_string_append_len (buff, tmp_str + loop, loop2 - 1); 104 // loop += loop2; 105 g_string_append_len (buff, tmp_str + loop, loop2); 106 loop += loop2 + 1; 102 g_string_append_len (buff, tmp_str + loop, loop2 - 1); 103 loop += loop2; 107 104 } 108 105 else 109 106 loop++; … … 126 123 tmp = mc_search__hex_translate_to_regex (mc_search_cond->str); 127 124 g_string_free (mc_search_cond->str, TRUE); 128 125 mc_search_cond->str = tmp; 129 lc_mc_search->is_case_sensitive = TRUE; // always case-sensitive here130 126 131 127 mc_search__cond_struct_new_init_regex (charset, lc_mc_search, mc_search_cond); 132 128 }