wget.c: replace deprecated gets with safe fgets
This commit is contained in:
parent
fbd78a7e3b
commit
dacef46b03
|
@ -169,14 +169,14 @@ PROCESS_THREAD(wget_process, ev, data)
|
||||||
strcpy(url, contiki_argv[1]);
|
strcpy(url, contiki_argv[1]);
|
||||||
puts(url);
|
puts(url);
|
||||||
} else {
|
} else {
|
||||||
gets(url);
|
fgets(url, sizeof(url), stdin);
|
||||||
}
|
}
|
||||||
fputs("Save as:", stdout);
|
fputs("Save as:", stdout);
|
||||||
if(contiki_argc > 2) {
|
if(contiki_argc > 2) {
|
||||||
strcpy(name, contiki_argv[2]);
|
strcpy(name, contiki_argv[2]);
|
||||||
puts(name);
|
puts(name);
|
||||||
} else {
|
} else {
|
||||||
gets(name);
|
fgets(name, sizeof(name), stdin);
|
||||||
}
|
}
|
||||||
file = cfs_open(name, CFS_WRITE);
|
file = cfs_open(name, CFS_WRITE);
|
||||||
if(file == -1) {
|
if(file == -1) {
|
||||||
|
|
Loading…
Reference in a new issue