aboutsummaryrefslogtreecommitdiff
path: root/networking/wget.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-03-06 22:11:45 +0000
committerEric Andersen <andersen@codepoet.org>2004-03-06 22:11:45 +0000
commit2479445562a9b5a9f226d0b00c41dbd533e63213 (patch)
treee4891420283c085d688683a41cc217dc896917b8 /networking/wget.c
parentc4db0833a6c91dd3714bec1db076a80910af6e30 (diff)
downloadbusybox-w32-2479445562a9b5a9f226d0b00c41dbd533e63213.tar.gz
busybox-w32-2479445562a9b5a9f226d0b00c41dbd533e63213.tar.bz2
busybox-w32-2479445562a9b5a9f226d0b00c41dbd533e63213.zip
Fix/eliminate use of atol
Diffstat (limited to 'networking/wget.c')
-rw-r--r--networking/wget.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/networking/wget.c b/networking/wget.c
index 823a053db..cb0790ea7 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -385,7 +385,11 @@ read_response:
385 */ 385 */
386 while ((s = gethdr(buf, sizeof(buf), sfp, &n)) != NULL) { 386 while ((s = gethdr(buf, sizeof(buf), sfp, &n)) != NULL) {
387 if (strcasecmp(buf, "content-length") == 0) { 387 if (strcasecmp(buf, "content-length") == 0) {
388 filesize = atol(s); 388 unsigned long value;
389 if (safe_strtoul(s, &value)) {
390 close_delete_and_die("content-length %s is garbage", s);
391 }
392 filesize = value;
389 got_clen = 1; 393 got_clen = 1;
390 continue; 394 continue;
391 } 395 }
@@ -452,7 +456,11 @@ read_response:
452 * Querying file size 456 * Querying file size
453 */ 457 */
454 if (ftpcmd("SIZE /", target.path, sfp, buf) == 213) { 458 if (ftpcmd("SIZE /", target.path, sfp, buf) == 213) {
455 filesize = atol(buf+4); 459 unsigned long value;
460 if (safe_strtoul(buf+4, &value)) {
461 close_delete_and_die("SIZE value is garbage");
462 }
463 filesize = value;
456 got_clen = 1; 464 got_clen = 1;
457 } 465 }
458 466
@@ -838,7 +846,7 @@ progressmeter(int flag)
838 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 846 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
839 * SUCH DAMAGE. 847 * SUCH DAMAGE.
840 * 848 *
841 * $Id: wget.c,v 1.69 2004/02/22 00:27:34 bug1 Exp $ 849 * $Id: wget.c,v 1.70 2004/03/06 22:11:44 andersen Exp $
842 */ 850 */
843 851
844 852