* @v value Option value
* @ret rc Return status code
*/
-static int tftp_process_blksize ( struct tftp_request *tftp,
- const char *value ) {
+static int tftp_process_blksize ( struct tftp_request *tftp, char *value ) {
char *end;
tftp->blksize = strtoul ( value, &end, 10 );
* @v value Option value
* @ret rc Return status code
*/
-static int tftp_process_tsize ( struct tftp_request *tftp,
- const char *value ) {
+static int tftp_process_tsize ( struct tftp_request *tftp, char *value ) {
char *end;
tftp->tsize = strtoul ( value, &end, 10 );
* @v value Option value
* @ret rc Return status code
*/
-static int tftp_process_multicast ( struct tftp_request *tftp,
- const char *value ) {
+static int tftp_process_multicast ( struct tftp_request *tftp, char *value ) {
union {
struct sockaddr sa;
struct sockaddr_in sin;
} socket;
- char buf[ strlen ( value ) + 1 ];
char *addr;
char *port;
char *port_end;
int rc;
/* Split value into "addr,port,mc" fields */
- memcpy ( buf, value, sizeof ( buf ) );
- addr = buf;
+ addr = value;
port = strchr ( addr, ',' );
if ( ! port ) {
DBGC ( tftp, "TFTP %p multicast missing port,mc\n", tftp );
* @v value Option value
* @ret rc Return status code
*/
- int ( * process ) ( struct tftp_request *tftp, const char *value );
+ int ( * process ) ( struct tftp_request *tftp, char *value );
};
/** Recognised TFTP options */
* @ret rc Return status code
*/
static int tftp_process_option ( struct tftp_request *tftp,
- const char *name, const char *value ) {
+ const char *name, char *value ) {
struct tftp_option *option;
for ( option = tftp_options ; option->name ; option++ ) {