Merge pull request #11 from conserver/6-clang-warning

Fix #6 - clang "-Wstring-plus-int" warning
This commit is contained in:
conserver.com 2019-02-13 23:34:05 -08:00 committed by GitHub
commit 0a4d65a504

View File

@ -560,10 +560,13 @@ DoNormalRead(CONSCLIENT *pCLServing)
if (iSep >= 0) { if (iSep >= 0) {
if (config->redirect == FLAGTRUE) { if (config->redirect == FLAGTRUE) {
REMOTE *pRC; REMOTE *pRC;
char *s;
for (pRC = pRCUniq; (REMOTE *)0 != pRC; for (pRC = pRCUniq; (REMOTE *)0 != pRC;
pRC = pRC->pRCuniq) { pRC = pRC->pRCuniq) {
s = ":@%s";
s += iSep;
FilePrint(pCLServing->fd, FLAGTRUE, FilePrint(pCLServing->fd, FLAGTRUE,
":@%s" + iSep, pRC->rhost); s, pRC->rhost);
iSep = 0; iSep = 0;
} }
} }
@ -642,12 +645,14 @@ DoNormalRead(CONSCLIENT *pCLServing)
strcmp(pcCmd, "groups") == 0) { strcmp(pcCmd, "groups") == 0) {
int iSep = 1; int iSep = 1;
GRPENT *pGE; GRPENT *pGE;
char *s;
for (pGE = pGroups; pGE != (GRPENT *)0; pGE = pGE->pGEnext) { for (pGE = pGroups; pGE != (GRPENT *)0; pGE = pGE->pGEnext) {
if (0 == pGE->imembers) if (0 == pGE->imembers)
continue; continue;
FilePrint(pCLServing->fd, FLAGTRUE, ":%hu" + iSep, s = ":%hu";
pGE->port); s += iSep;
FilePrint(pCLServing->fd, FLAGTRUE, s, pGE->port);
iSep = 0; iSep = 0;
} }
FileWrite(pCLServing->fd, FLAGFALSE, "\r\n", 2); FileWrite(pCLServing->fd, FLAGFALSE, "\r\n", 2);