diff --git a/src/xmppipe.c b/src/xmppipe.c index ab2bb2e..333ad0e 100644 --- a/src/xmppipe.c +++ b/src/xmppipe.c @@ -324,7 +324,7 @@ int xmppipe_connect_init(xmppipe_state_t *state) { } int xmppipe_stream_init(xmppipe_state_t *state) { - xmpp_stanza_t *enable = NULL; + xmpp_stanza_t *enable; if (state->sm_request_interval == 0) return 0; @@ -476,9 +476,9 @@ int handle_disco_items(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, for (item = xmpp_stanza_get_children(query); item != NULL; item = xmpp_stanza_get_next(item)) { xmpp_stanza_t *iq, *reply; - const char *jid = NULL; - const char *name = NULL; - char *id = NULL; + const char *jid; + const char *name; + char *id; name = xmpp_stanza_get_name(item); if (name == NULL) diff --git a/src/xmppipe_util.c b/src/xmppipe_util.c index ad26fc3..bc2c941 100644 --- a/src/xmppipe_util.c +++ b/src/xmppipe_util.c @@ -39,7 +39,7 @@ const char *const xmppipe_states[] = {"XMPPIPE_S_DISCONNECTED", static char *xmppipe_join(char *prefix, char *delimiter, char *suffix); int xmppipe_set_nonblock(int fd) { - int flags = 0; + int flags; flags = fcntl(fd, F_GETFD); if (flags < 0) @@ -61,7 +61,7 @@ char *xmppipe_getenv(const char *s) { } char *xmppipe_strdup(const char *s) { - char *buf = NULL; + char *buf; if (s == NULL) errx(2, "invalid string"); @@ -74,7 +74,7 @@ char *xmppipe_strdup(const char *s) { } void *xmppipe_malloc(size_t size) { - char *buf = NULL; + char *buf; if (size == 0 || size > 0xffff) errx(2, "invalid size: %zd", size); @@ -87,7 +87,7 @@ void *xmppipe_malloc(size_t size) { } void *xmppipe_calloc(size_t nmemb, size_t size) { - char *buf = NULL; + char *buf; buf = calloc(nmemb, size); if (buf == NULL) @@ -251,7 +251,7 @@ static char *xmppipe_join(char *prefix, char *delimiter, char *suffix) { } char *xmppipe_roomname(char *label) { - char *buf = NULL; + char *buf; size_t len = 64; char name[16] = {0};