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++);
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
}
int
-tftp_stream_read(char *buf,
+tftp_stream_read(void *buf,
int len,
int *err)
{
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;