Compare commits

...

4 Commits

Author SHA1 Message Date
yancey
17694ecaa9 fix more sanitizer complaint 2023-07-22 18:16:33 -04:00
yancey
c3debb0290 sync udp2raw bugfix 2023-07-22 14:45:53 -04:00
Yancey Wang
3ac5e6b40d
Update CMakeLists.txt 2023-06-04 21:45:31 -04:00
Yancey Wang
ca5444b4a7
Update ISSUE_TEMPLATE.md 2023-05-10 00:07:31 -04:00
4 changed files with 9 additions and 6 deletions

View File

@ -1,4 +1,6 @@
#note: experimental #note: experimental
# currently only used for generating `compile_commands.json` for clangd
# to build this project, it's suggested to use `makefile` instead
cmake_minimum_required(VERSION 3.7) cmake_minimum_required(VERSION 3.7)
project(speederv2) project(speederv2)

View File

@ -1 +1 @@
English Only (except for bug reporting). English Only.

View File

@ -895,8 +895,8 @@ int new_connected_socket2(int &fd, address_t &addr, address_t *bind_addr, char *
u32_t djb2(unsigned char *str, int len) { u32_t djb2(unsigned char *str, int len) {
u32_t hash = 5381; u32_t hash = 5381;
int c; int c;
int i = 0; for (int i=0; i<len ;i++) {
while (c = *str++, i++ != len) { c = *(str++);
hash = ((hash << 5) + hash) ^ c; /* (hash * 33) ^ c */ hash = ((hash << 5) + hash) ^ c; /* (hash * 33) ^ c */
} }
@ -907,14 +907,15 @@ u32_t djb2(unsigned char *str, int len) {
u32_t sdbm(unsigned char *str, int len) { u32_t sdbm(unsigned char *str, int len) {
u32_t hash = 0; u32_t hash = 0;
int c; int c;
int i = 0; for (int i=0; i<len ;i++) {
while (c = *str++, i++ != len) { c = *(str++);
hash = c + (hash << 6) + (hash << 16) - hash; hash = c + (hash << 6) + (hash << 16) - hash;
} }
// hash=htonl(hash); // hash=htonl(hash);
return hash; return hash;
} }
vector<string> string_to_vec(const char *s, const char *sp) { vector<string> string_to_vec(const char *s, const char *sp) {
vector<string> res; vector<string> res;
string str = s; string str = s;

View File

@ -413,7 +413,7 @@ class fec_decode_manager_t : not_copy_able_t {
mylog(log_debug, "fec_decode_manager destroyed\n"); mylog(log_debug, "fec_decode_manager destroyed\n");
if (fec_data != 0) { if (fec_data != 0) {
mylog(log_debug, "fec_data freed\n"); mylog(log_debug, "fec_data freed\n");
delete fec_data; delete[] fec_data;
} }
} }
int clear() { int clear() {