Compare commits

..

7 Commits

Author SHA1 Message Date
Yancey Wang
f3f528e866 Revert "fix CMakeLists.txt" 2023-07-22 17:30:56 -04:00
Yancey Wang
ec6fad552b Merge pull request #455 from HiGarfield/unified
fix CMakeLists.txt
2023-07-22 17:09:53 -04:00
yancey
87b878a09e fix stack-use-after-scope reported by sanitizer 2023-07-22 14:31:17 -04:00
yancey
e66eddd1d5 fix mem access problem reported by sanitizer 2023-07-22 14:00:03 -04:00
Yancey Wang
d12e540830 Update CMakeLists.txt 2023-06-04 21:44:44 -04:00
Yancey Wang
e7eecc8ef2 Update ISSUE_TEMPLATE.md 2023-05-10 00:08:00 -04:00
HiGarfield
82ba4f7d1b fix CMakeLists.txt 2023-02-09 01:23:51 +08:00
4 changed files with 12 additions and 9 deletions

View File

@@ -1,4 +1,7 @@
#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)
project(udp2raw)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

View File

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

View File

@@ -1127,8 +1127,8 @@ void print_binary_chars(const char *a, int len) {
u32_t djb2(unsigned char *str, int len) {
u32_t hash = 5381;
int c;
int i = 0;
while (c = *str++, i++ != len) {
for (int i=0; i<len ;i++) {
c = *(str++);
hash = ((hash << 5) + hash) ^ c; /* (hash * 33) ^ c */
}
@@ -1139,8 +1139,8 @@ u32_t djb2(unsigned char *str, int len) {
u32_t sdbm(unsigned char *str, int len) {
u32_t hash = 0;
int c;
int i = 0;
while (c = *str++, i++ != len) {
for (int i=0; i<len ;i++) {
c = *(str++);
hash = c + (hash << 6) + (hash << 16) - hash;
}
// hash=htonl(hash);

View File

@@ -40,19 +40,19 @@ int main(int argc, char *argv[]) {
pre_process_arg(argc, argv);
ev_signal signal_watcher_sigpipe;
ev_signal signal_watcher_sigterm;
ev_signal signal_watcher_sigint;
if (program_mode == client_mode) {
struct ev_loop *loop = ev_default_loop(0);
#if !defined(__MINGW32__)
ev_signal signal_watcher_sigpipe;
ev_signal_init(&signal_watcher_sigpipe, sigpipe_cb, SIGPIPE);
ev_signal_start(loop, &signal_watcher_sigpipe);
#endif
ev_signal signal_watcher_sigterm;
ev_signal_init(&signal_watcher_sigterm, sigterm_cb, SIGTERM);
ev_signal_start(loop, &signal_watcher_sigterm);
ev_signal signal_watcher_sigint;
ev_signal_init(&signal_watcher_sigint, sigint_cb, SIGINT);
ev_signal_start(loop, &signal_watcher_sigint);
} else {