Correction of message data entry in rxtx and send utilities.
authorppisa <ppisa>
Tue, 28 Feb 2006 13:08:03 +0000 (13:08 +0000)
committerppisa <ppisa>
Tue, 28 Feb 2006 13:08:03 +0000 (13:08 +0000)
lincan/utils/can-proxy.c
lincan/utils/rxtx.c
lincan/utils/send.c

index b602770..d9dbcdd 100644 (file)
@@ -151,7 +151,7 @@ int WriteNet(int fd, void * msg, int size) {
 int ReadNet(int fd, void * msg, int size) {
        char recvbuf[MAX_MSG_SIZE];
        int ret;
-       int recvaddrsize = sizeof(recvaddr);
+       unsigned int recvaddrsize = sizeof(recvaddr);
 
        // setting recvaddr is required for non-connected sockets
        memcpy(&recvaddr, &fromaddr, sizeof(recvaddr));
index ff611e1..62c64a0 100644 (file)
@@ -62,8 +62,10 @@ int main(void)
                scanf("%d",&msglen);
                message.length=msglen;
                for (i=0; i<message.length; i++) {
+                       int val;
                        printf("Enter data byte [%d] ",i);
-                       scanf("%x",(int *)&message.data[i]);
+                       scanf("%x",&val);
+                       message.data[i]=val;
                }
        }       
        if (*transmission=='r') {
index 9f2dca7..b8171fd 100644 (file)
@@ -35,8 +35,10 @@ int main(void)
        scanf("%d",&msglen);
        message.length=msglen;
        for (i=0; i<message.length; i++) {
+               int val;
                printf("Enter data byte [%d] ",i);
-               scanf("%x",(int *)&message.data[i]);
+               scanf("%x",&val);
+               message.data[i]=val;
        }
 
        fd=open(specialfile,O_RDWR);