diff options
| author | Nakidai <nakidai@disroot.org> | 2026-02-01 20:04:41 +0300 |
|---|---|---|
| committer | Nakidai <nakidai@disroot.org> | 2026-02-01 20:04:41 +0300 |
| commit | e50f850d763e3b1e6b06b4b312512a5b006eabbc (patch) | |
| tree | 8f40752a756182fff9615187b3f482c73b77fdef | |
| parent | ac52bbe3427cda3bd2098ee35e06163885b21836 (diff) | |
| download | libreircd-e50f850d763e3b1e6b06b4b312512a5b006eabbc.tar.gz libreircd-e50f850d763e3b1e6b06b4b312512a5b006eabbc.zip | |
Fix all the warnings
The one in user.c is the funniest one
| -rw-r--r-- | handle.c | 4 | ||||
| -rw-r--r-- | main.c | 2 | ||||
| -rw-r--r-- | user.c | 4 | ||||
| -rw-r--r-- | writef.c | 2 |
4 files changed, 8 insertions, 4 deletions
diff --git a/handle.c b/handle.c index 698e8a9..e84f098 100644 --- a/handle.c +++ b/handle.c @@ -169,6 +169,8 @@ ping(struct Message *msg, struct Peer *peer) static int pong(struct Message *msg, struct Peer *peer) { + ensure(msg->params[0] && *msg->params[0], reply(peer, 409), 0); + peer->ping = 0; return 0; @@ -246,8 +248,6 @@ privmsg(struct Message *msg, struct Peer *peer) static int quit(struct Message *msg, struct Peer *peer) { - ensure(peer->type, (void)0, 1) - strlcpy(peer->quit, msg->params[0] ? msg->params[0] : "Client Quit", PEER_QUIT_MAX); return 1; diff --git a/main.c b/main.c index 26de6e6..324309f 100644 --- a/main.c +++ b/main.c @@ -33,6 +33,8 @@ main(int argc, char **argv) size_t i; char *p; + (void)argc; + for (i = 1; i < 4; ++i) if (!argv[i] || !*argv[i]) errx(1, "usage: %s hostname bindaddr port", argv[0]); diff --git a/user.c b/user.c index 84c6584..ba88beb 100644 --- a/user.c +++ b/user.c @@ -51,7 +51,9 @@ user_reg(struct Peer *peer, const char *nick, const char *user, const char *real { int was_registered; unsigned long m; - const char *p; + /* c language is stupid shit: declaring p correctly (as const char *, as mode points + * to a const char) causes a warning, so to silence it p should be char * */ + char *p; was_registered = *peer->nick && *peer->user && *peer->real; diff --git a/writef.c b/writef.c index c5e6b95..51346d9 100644 --- a/writef.c +++ b/writef.c @@ -30,7 +30,7 @@ static void vstoref(const char *fmt, va_list ap) { written = vsnprintf(buf, sizeof(buf) - 2, fmt, ap); - written = written < sizeof(buf) - 2 ? written : sizeof(buf) - 2; + written = written < (int)sizeof(buf) - 2 ? written : sizeof(buf) - 2; memcpy(buf + written, "\r\n", 2); written += 2; } |