summaryrefslogtreecommitdiff
path: root/network/linksys-tftp/linksys-tftp-1.2.1-r1-header.patch
blob: 9944f3c059bc18fd9b82ca89a7120e0c26638e85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--- linksys-tftp-1.2.1/main.c
+++ linksys-tftp-1.2.1/main.c
@@ -40,6 +40,10 @@
 #include <setjmp.h>
 #include <ctype.h>
 #include <netdb.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/sendfile.h>
 
 #define	TIMEOUT		5		/* secs between rexmt's */
 
@@ -110,7 +112,7 @@
 char	*index();
 char	*rindex();
 
-main(argc, argv)
+int main(argc, argv)
 	char *argv[];
 {
 	struct sockaddr_in sin;
--- a/tftp.c
+++ b/tftp.c
@@ -36,8 +36,8 @@
 #include <stdio.h>
 #include <errno.h>
 #include <setjmp.h>
-
-extern	int errno;
+#include <string.h>
+#include <unistd.h>
 
 extern  struct sockaddr_in sin;         /* filled in by main */
 extern  int     f;                      /* the opened socket */
@@ -69,16 +69,6 @@ void timer(int sig)
 	longjmp(timeoutbuf, 1);
 }
 
-strnlen(s, n)
-	char *s;
-	int n;
-{
-	int i = 0;
-
-	while (n-- > 0 && *s++) i++;
-	return(i);
-}
-
 /*
  * Parse an OACK package and set blocksize accordingly
  */