428fdf942e
Unbreak tftp, since converting the struct members from arrays to pointers badly broke the code, ok rui@ (maintainer).
31 lines
978 B
Plaintext
31 lines
978 B
Plaintext
$OpenBSD: patch-src_tftp_c,v 1.5 2009/06/14 17:07:25 kili Exp $
|
|
--- src/tftp.c.orig Mon Jun 8 23:12:43 2009
|
|
+++ src/tftp.c Sat Jun 13 12:05:54 2009
|
|
@@ -481,7 +481,7 @@ static ssize_t tftp_err(int err, char *packet, char *m
|
|
{
|
|
struct errmess {
|
|
unsigned short op, err;
|
|
- char message[];
|
|
+ char message[0];
|
|
} *mess = (struct errmess *)packet;
|
|
ssize_t ret = 4;
|
|
char *errstr = strerror(errno);
|
|
@@ -508,7 +508,7 @@ static ssize_t get_block(char *packet, struct tftp_tra
|
|
char *p;
|
|
struct oackmess {
|
|
unsigned short op;
|
|
- char data[];
|
|
+ char data[0];
|
|
} *mess = (struct oackmess *)packet;
|
|
|
|
p = mess->data;
|
|
@@ -531,7 +531,7 @@ static ssize_t get_block(char *packet, struct tftp_tra
|
|
/* send data packet */
|
|
struct datamess {
|
|
unsigned short op, block;
|
|
- unsigned char data[];
|
|
+ unsigned char data[0];
|
|
} *mess = (struct datamess *)packet;
|
|
|
|
size_t size = transfer->file->size - transfer->offset;
|