diff --git a/m-serial-json.h b/m-serial-json.h index 3484b0cf..b0636bee 100644 --- a/m-serial-json.h +++ b/m-serial-json.h @@ -972,6 +972,7 @@ m_ser1al_str_json_read_array_start(m_serial_local_t local, m_serial_read_t seria m_ser1al_str_json_skip(f); if (M_UNLIKELY (**f == ']')) { c = m_ser1al_str_json_getc(f); + assert( c == ']'); return M_SERIAL_OK_DONE; } else { return M_SERIAL_OK_CONTINUE; @@ -1013,6 +1014,7 @@ m_ser1al_str_json_read_map_start(m_serial_local_t local, m_serial_read_t serial, m_ser1al_str_json_skip(f); if (M_UNLIKELY (**f == '}')) { c = m_ser1al_str_json_getc(f); + assert(c == '}'); return M_SERIAL_OK_DONE; } else { return M_SERIAL_OK_CONTINUE; diff --git a/m-string.h b/m-string.h index 6e0890f4..a2b5ddfb 100644 --- a/m-string.h +++ b/m-string.h @@ -888,7 +888,6 @@ m_str1ng_replace_all_cstr_1ge2 (m_string_t v, const char str1[], size_t str1len, memmove(dst, src, (size_t) (occ - src)); } dst += (occ - src); - src = occ; // Copy the replaced string memcpy(dst, str2, str2len); dst += str2len;