]> git.kernelconcepts.de Git - karo-tx-redboot.git/blobdiff - packages/redboot/v2_0/src/net/tftp_client.c
unified MX27, MX25, MX37 trees
[karo-tx-redboot.git] / packages / redboot / v2_0 / src / net / tftp_client.c
index e282ca90efc9ebebafac2e267035f230b5e94fcd..7f471f608b3d9613065f0316e1832bd379b941e6 100644 (file)
@@ -98,7 +98,7 @@ tftp_stream_open(connection_info_t *info,
     while (*fp) *cp++ = *fp++;
     *cp++ = '\0';
 
-    memset((char *)&tftp_stream.local_addr, 0, sizeof(tftp_stream.local_addr));
+    memset(&tftp_stream.local_addr, 0, sizeof(tftp_stream.local_addr));
     tftp_stream.local_addr.sin_family = AF_INET;
     tftp_stream.local_addr.sin_addr.s_addr = htonl(INADDR_ANY);
     tftp_stream.local_addr.sin_port = htons(get_port++);
@@ -164,13 +164,13 @@ tftp_error_ack(int *err, short code, char *msg)
     struct tftphdr *hdr = (struct tftphdr *)tftp_stream.data;
 
     if (strlen(msg) > (SEGSIZE-1)) {
-      *(msg + SEGSIZE) = '\0';
+      *(msg + SEGSIZE) = 0;
     }
 
     if (tftp_stream.packets_received > 0) {
         hdr->th_opcode = htons(ERROR);
         hdr->th_code = code;
-        strcpy((char*)&hdr->th_data, msg);
+        strcpy((char *)&hdr->th_data, msg);
         if (__udp_sendto(tftp_stream.data, (5 + strlen(msg)), 
                          &tftp_stream.from_addr, &tftp_stream.local_addr) < 0) {
             // Problem sending ACK
@@ -205,7 +205,7 @@ tftp_stream_terminate(bool abort,
 }
 
 int
-tftp_stream_read(char *buf,
+tftp_stream_read(void *buf,
                  int len,
                  int *err)
 {
@@ -220,7 +220,7 @@ tftp_stream_read(char *buf,
             size = tftp_stream.avail;
             if (size > (len - total_bytes)) size = len - total_bytes;
             memcpy(buf, tftp_stream.bufp, size);
-            buf += size;
+            buf = (char *)buf + size;
             tftp_stream.bufp += size;
             tftp_stream.avail -= size;
             total_bytes += size;