Make this compile with GCC4 by fixing a few signedness related warnings.
Reviewed by: md5(1)
This commit is contained in:
parent
d95f635399
commit
87934eb0bc
@ -243,7 +243,7 @@ _NgDebugMsg(const struct ng_mesg *msg, const char *path)
|
||||
fail2:
|
||||
NGLOGX(" cmd %d", msg->header.cmd);
|
||||
NGLOGX(" args (%d bytes)", msg->header.arglen);
|
||||
_NgDebugBytes(msg->data, msg->header.arglen);
|
||||
_NgDebugBytes((u_char *)msg->data, msg->header.arglen);
|
||||
|
||||
done:
|
||||
if (csock != -1)
|
||||
|
@ -76,7 +76,7 @@ NgSendMsg(int cs, const char *path,
|
||||
msg.header.token = gMsgId;
|
||||
msg.header.flags = NGF_ORIG;
|
||||
msg.header.cmd = cmd;
|
||||
snprintf(msg.header.cmdstr, NG_CMDSTRSIZ, "cmd%d", cmd);
|
||||
snprintf((char *)msg.header.cmdstr, NG_CMDSTRSIZ, "cmd%d", cmd);
|
||||
|
||||
/* Deliver message */
|
||||
if (NgDeliverMsg(cs, path, &msg, args, arglen) < 0)
|
||||
@ -122,7 +122,8 @@ NgSendAsciiMsg(int cs, const char *path, const char *fmt, ...)
|
||||
memset(ascii, 0, sizeof(*ascii));
|
||||
|
||||
/* Build inner header (only need cmdstr, arglen, and data fields) */
|
||||
strncpy(ascii->header.cmdstr, cmd, sizeof(ascii->header.cmdstr) - 1);
|
||||
strncpy((char *)ascii->header.cmdstr, cmd,
|
||||
sizeof(ascii->header.cmdstr) - 1);
|
||||
strcpy(ascii->data, args);
|
||||
ascii->header.arglen = strlen(ascii->data) + 1;
|
||||
free(buf);
|
||||
@ -249,8 +250,8 @@ NgRecvMsg(int cs, struct ng_mesg *rep, size_t replen, char *path)
|
||||
{
|
||||
u_char sgbuf[NG_PATHSIZ + NGSA_OVERHEAD];
|
||||
struct sockaddr_ng *const sg = (struct sockaddr_ng *) sgbuf;
|
||||
int len, sglen = sizeof(sgbuf);
|
||||
int errnosv;
|
||||
socklen_t sglen = sizeof(sgbuf);
|
||||
int len, errnosv;
|
||||
|
||||
/* Read reply */
|
||||
len = recvfrom(cs, rep, replen, 0, (struct sockaddr *) sg, &sglen);
|
||||
|
@ -213,7 +213,7 @@ NgRecvData(int ds, u_char * buf, size_t len, char *hook)
|
||||
{
|
||||
u_char frombuf[NG_HOOKSIZ + NGSA_OVERHEAD];
|
||||
struct sockaddr_ng *const from = (struct sockaddr_ng *) frombuf;
|
||||
int fromlen = sizeof(frombuf);
|
||||
socklen_t fromlen = sizeof(frombuf);
|
||||
int rtn, errnosv;
|
||||
|
||||
/* Read packet */
|
||||
|
Loading…
Reference in New Issue
Block a user