Fix/eliminate use of atol
This commit is contained in:
@@ -147,7 +147,10 @@ static int ftp_recieve(ftp_host_info_t *server, FILE *control_stream,
|
||||
fd_data = xconnect_ftpdata(server, buf);
|
||||
|
||||
if (ftpcmd("SIZE ", server_path, control_stream, buf) == 213) {
|
||||
filesize = atol(buf + 4);
|
||||
unsigned long value=filesize;
|
||||
if (safe_strtoul(buf + 4, &filesize))
|
||||
bb_error_msg_and_die("SIZE error: %s", buf + 4);
|
||||
filesize = value;
|
||||
}
|
||||
|
||||
if ((local_path[0] == '-') && (local_path[1] == '\0')) {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* $Id: ifconfig.c,v 1.27 2003/11/14 03:04:08 andersen Exp $
|
||||
* $Id: ifconfig.c,v 1.28 2004/03/06 22:11:44 andersen Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -394,8 +394,9 @@ int ifconfig_main(int argc, char **argv)
|
||||
safe_strncpy(host, *argv, (sizeof host));
|
||||
#ifdef CONFIG_FEATURE_IPV6
|
||||
if ((prefix = strchr(host, '/'))) {
|
||||
prefix_len = atol(prefix + 1);
|
||||
if ((prefix_len < 0) || (prefix_len > 128)) {
|
||||
if (safe_strtoi(prefix + 1, &prefix_len) ||
|
||||
(prefix_len < 0) || (prefix_len > 128))
|
||||
{
|
||||
++goterr;
|
||||
goto LOOP;
|
||||
}
|
||||
|
||||
@@ -119,8 +119,7 @@ int ipcalc_main(int argc, char **argv)
|
||||
if (*prefixstr) {
|
||||
unsigned int msk;
|
||||
|
||||
netprefix = atol(prefixstr);
|
||||
if (netprefix > 32) {
|
||||
if (safe_strtoul(prefixstr, &netprefix) || netprefix > 32) {
|
||||
IPCALC_MSG(bb_error_msg_and_die("bad IP prefix: %s\n", prefixstr),
|
||||
exit(EXIT_FAILURE));
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* $Id: route.c,v 1.22 2003/03/19 09:12:39 mjn3 Exp $
|
||||
* $Id: route.c,v 1.23 2004/03/06 22:11:44 andersen Exp $
|
||||
*
|
||||
* displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru>
|
||||
* adjustments by Larry Doolittle <LRDoolittle@lbl.gov>
|
||||
@@ -351,8 +351,7 @@ static int INET6_setroute(int action, int options, char **args)
|
||||
memset(&sa6, 0, sizeof(sa6));
|
||||
} else {
|
||||
if ((cp = strchr(target, '/'))) {
|
||||
prefix_len = atol(cp + 1);
|
||||
if ((prefix_len < 0) || (prefix_len > 128))
|
||||
if (safe_strtod(cp + 1, &prefix_len) || (prefix_len < 0) || (prefix_len > 128))
|
||||
bb_show_usage();
|
||||
*cp = 0;
|
||||
} else {
|
||||
|
||||
@@ -385,7 +385,11 @@ read_response:
|
||||
*/
|
||||
while ((s = gethdr(buf, sizeof(buf), sfp, &n)) != NULL) {
|
||||
if (strcasecmp(buf, "content-length") == 0) {
|
||||
filesize = atol(s);
|
||||
unsigned long value;
|
||||
if (safe_strtoul(s, &value)) {
|
||||
close_delete_and_die("content-length %s is garbage", s);
|
||||
}
|
||||
filesize = value;
|
||||
got_clen = 1;
|
||||
continue;
|
||||
}
|
||||
@@ -452,7 +456,11 @@ read_response:
|
||||
* Querying file size
|
||||
*/
|
||||
if (ftpcmd("SIZE /", target.path, sfp, buf) == 213) {
|
||||
filesize = atol(buf+4);
|
||||
unsigned long value;
|
||||
if (safe_strtoul(buf+4, &value)) {
|
||||
close_delete_and_die("SIZE value is garbage");
|
||||
}
|
||||
filesize = value;
|
||||
got_clen = 1;
|
||||
}
|
||||
|
||||
@@ -838,7 +846,7 @@ progressmeter(int flag)
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: wget.c,v 1.69 2004/02/22 00:27:34 bug1 Exp $
|
||||
* $Id: wget.c,v 1.70 2004/03/06 22:11:44 andersen Exp $
|
||||
*/
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user