diff --git a/src/uirc.c b/src/uirc.c index 78e03ba..c3897f5 100644 --- a/src/uirc.c +++ b/src/uirc.c @@ -132,12 +132,12 @@ signed int Tok_mesg(char* str, IRC_Message* out) } int i; - for (i = 0; *progr != ':' && i < 14 && *progr != '\0'; i++) { + for (i = 0; *progr != ':' && i < 14 && *progr; i++) { if ((out->args[i] = strtok_r(NULL, " ", &progr)) == NULL) return ERR_UIRC_INVALID_FORMAT; } out->args[i] = NULL; - if (*progr != '\0') + if (*progr) out->trailing = (*progr == ':') ? progr + 1 : progr; return 1; } @@ -214,7 +214,7 @@ signed int Assm_tags(char* buf, IRC_Tags* in) if (sprintf(pos++, "+") != 1) return ERR_UIRC_BUFFER_ERR; } - cnt = (*(*tagmps[i].assg).value != '\0') ? sprintf(pos, "%s=%s", tagmps[i].name, (*tagmps[i].assg).value) : sprintf(pos, "%s", tagmps[i].name); + cnt = (*(*tagmps[i].assg).value) ? sprintf(pos, "%s=%s", tagmps[i].name, (*tagmps[i].assg).value) : sprintf(pos, "%s", tagmps[i].name); if (cnt > 0) pos += cnt; else @@ -310,7 +310,7 @@ signed int Tok_user(char* str, IRC_User* out, bool useorig) *(out->orig++) = '\0'; if ((out->user = strchr(pos, '!')) != NULL) /* RFC2812 says this cannot be here without the host but RFC1459 says it can, we accept both options */ *((char*)out->user++) = '\0'; - if (*(out->nick = pos) == '\0') /* NOTE: This may be the server instead of a nick according to RFC2812, it is left to the library out to decide how to interpret this based on the context. */ + if (!*(out->nick = pos)) /* NOTE: This may be the server instead of a nick according to RFC2812, it is left to the library out to decide how to interpret this based on the context. */ return ERR_UIRC_INVALID_FORMAT; return 1; }