diff --git a/src/action.c b/src/action.c index d338237..d25a102 100755 --- a/src/action.c +++ b/src/action.c @@ -29,7 +29,7 @@ int uh_add_action(struct uh_server *srv, const char *path, action_cb_t cb) { struct uh_action *a; - a = calloc(1, sizeof(struct uh_action)); + a = calloc(1, sizeof(struct uh_action) + strlen(path) + 1); if (!a) { uh_log_err("calloc"); return -1; diff --git a/src/action.h b/src/action.h index 9a368ea..2eb4e9f 100755 --- a/src/action.h +++ b/src/action.h @@ -28,8 +28,8 @@ typedef void (*action_cb_t)(struct uh_client *cl); struct uh_action { struct avl_node avl; - char path[PATH_MAX]; action_cb_t cb; + char path[0]; }; int uh_add_action(struct uh_server *srv, const char *path, action_cb_t cb);