Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 890953 Details for
Bug 928051
net-ftp/linksys-tftp: last rites request
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Update tftpsubs.c to be Standard C compliant.
linksys-tftp-1.2.1-stdc-tftpsubs.patch (text/plain), 3.64 KB, created by
Richard Narron
on 2024-04-16 22:33:25 UTC
(
hide
)
Description:
Update tftpsubs.c to be Standard C compliant.
Filename:
MIME Type:
Creator:
Richard Narron
Created:
2024-04-16 22:33:25 UTC
Size:
3.64 KB
patch
obsolete
>--- linksys-tftp-1.2.1/tftpsubs.c 2024-04-16 08:27:50.310449884 -0700 >+++ linksys-tftp-1.2.1/tftpsubs.c 2024-04-16 08:53:26.084521570 -0700 >@@ -38,6 +38,7 @@ static char sccsid[] = "@(#)tftpsubs.c 5 > // modified tftp header to include pass > #include <tftp.h> > #include <stdio.h> >+#include <unistd.h> > > #define PKTSIZE (1432+4) /* SEGSIZE+4 */ /* should be moved to tftp.h */ > >@@ -60,14 +61,22 @@ static int current; /* index of buff > int newline = 0; /* fillbuf: in middle of newline expansion */ > int prevchar = -1; /* putbuf: previous char (cr check) */ > >-struct tftphdr *rw_init(); >+/* functions declared in this program */ >+struct tftphdr *w_init(); >+struct tftphdr *r_init(); >+struct tftphdr *rw_init(int x); >+int readit(FILE *file, struct tftphdr **dpp, int convert); >+int read_ahead(FILE *file, int convert); >+int writeit(FILE *file, struct tftphdr **dpp, int ct, int convert); >+int write_behind( FILE *file, int convert); >+int synchnet(int f); > > struct tftphdr *w_init() { return rw_init(0); } /* write-behind */ > struct tftphdr *r_init() { return rw_init(1); } /* read-ahead */ > >-struct tftphdr * >-rw_init(x) /* init for either read-ahead or write-behind */ >-int x; /* zero for write-behind, one for read-head */ >+/* init for either read-ahead or write-behind */ >+struct tftphdr *rw_init(int x) >+ /* zero for write-behind, one for read-head */ > { > newline = 0; /* init crlf flag */ > prevchar = -1; >@@ -82,10 +91,8 @@ int x; /* zero for writ > /* Have emptied current buffer by sending to net and getting ack. > Free it and return next buffer filled with data. > */ >-readit(file, dpp, convert) >- FILE *file; /* file opened for read */ >- struct tftphdr **dpp; >- int convert; /* if true, convert to ascii */ >+int readit(FILE *file, struct tftphdr **dpp, int convert) >+ /* file opened for read if true, convert to ascii */ > { > struct bf *b; > >@@ -104,9 +111,9 @@ readit(file, dpp, convert) > * fill the input buffer, doing ascii conversions if requested > * conversions are lf -> cr,lf and cr -> cr, nul > */ >-read_ahead(file, convert) >- FILE *file; /* file opened for read */ >- int convert; /* if true, convert to ascii */ >+int read_ahead(FILE *file, int convert) >+ /* file opened for read */ >+ /* if true, convert to ascii */ > { > register int i; > register char *p; >@@ -154,16 +161,14 @@ read_ahead(file, convert) > *p++ = c; > } > b->counter = (int)(p - dp->th_data); >+ return 0; > } > > /* Update count associated with the buffer, get new buffer > from the queue. Calls write_behind only if next buffer not > available. > */ >-writeit(file, dpp, ct, convert) >- FILE *file; >- struct tftphdr **dpp; >- int convert; >+int writeit(FILE *file, struct tftphdr **dpp, int ct, int convert) > { > bfs[current].counter = ct; /* set size of data to write */ > current = !current; /* switch to other buffer */ >@@ -180,9 +185,7 @@ writeit(file, dpp, ct, convert) > * Note spec is undefined if we get CR as last byte of file or a > * CR followed by anything else. In this case we leave it alone. > */ >-write_behind(file, convert) >- FILE *file; >- int convert; >+int write_behind( FILE *file, int convert) > { > char *buf; > int count; >@@ -238,9 +241,8 @@ skipit: > * when trace is active). > */ > >-int >-synchnet(f) >-int f; /* socket to flush */ >+int synchnet(int f) >+ /* socket to flush */ > { > int i, j = 0; > char rbuf[PKTSIZE]; >@@ -258,4 +260,5 @@ int f; /* socket to flush */ > return(j); > } > } >+ return 0; /* should never get here */ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 928051
: 890953 |
890954
|
890955