From: provos Date: Mon, 14 Apr 1997 10:04:19 +0000 (+0000) Subject: strtol to strtoul X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=052340c0aa0f6360a2319810e902312e1207086e;p=openbsd strtol to strtoul --- diff --git a/sbin/ipsec/delspi/delspi.c b/sbin/ipsec/delspi/delspi.c index 8894144334d..133d3efdc5a 100644 --- a/sbin/ipsec/delspi/delspi.c +++ b/sbin/ipsec/delspi/delspi.c @@ -82,7 +82,7 @@ char **argv; em->em_type = EMT_DELSPICHAIN; else em->em_type = EMT_DELSPI; - em->em_spi = htonl(strtol(argv[2], NULL, 16)); + em->em_spi = htonl(strtoul(argv[2], NULL, 16)); em->em_if = 1; em->em_dst.s_addr = inet_addr(argv[1]); em->em_alg = atoi(argv[4]); /* sanity checking in the kernel */ diff --git a/sbin/ipsec/ipsecadm/ipsecadm.c b/sbin/ipsec/ipsecadm/ipsecadm.c index 757d7ffa7b0..c93557e5598 100644 --- a/sbin/ipsec/ipsecadm/ipsecadm.c +++ b/sbin/ipsec/ipsecadm/ipsecadm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipsecadm.c,v 1.1 1997/03/01 15:08:24 provos Exp $ */ +/* $OpenBSD: ipsecadm.c,v 1.2 1997/04/14 10:04:27 provos Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, * (except when noted otherwise). @@ -89,7 +89,7 @@ x2i(char *s) ss[1] = s[1]; ss[2] = 0; - return strtol(ss, NULL, 16); + return strtoul(ss, NULL, 16); } void diff --git a/sbin/ipsec/ipsecadm/xf_ahhmacmd5.c b/sbin/ipsec/ipsecadm/xf_ahhmacmd5.c index 27c97adbeee..a604007f23c 100644 --- a/sbin/ipsec/ipsecadm/xf_ahhmacmd5.c +++ b/sbin/ipsec/ipsecadm/xf_ahhmacmd5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xf_ahhmacmd5.c,v 1.1 1997/03/01 15:08:25 provos Exp $ */ +/* $OpenBSD: xf_ahhmacmd5.c,v 1.2 1997/04/14 10:04:28 provos Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, * (except when noted otherwise). @@ -77,7 +77,7 @@ char **argv; em->em_msglen = EMT_SETSPI_FLEN + 4 + AHHMACMD5_KMAX; em->em_version = 0; em->em_type = EMT_SETSPI; - em->em_spi = htonl(strtol(argv[2], NULL, 16)); + em->em_spi = htonl(strtoul(argv[2], NULL, 16)); em->em_if = 1; em->em_dst.s_addr = inet_addr(argv[1]); em->em_alg = XF_AHHMACMD5; diff --git a/sbin/ipsec/ipsecadm/xf_ahhmacsha1.c b/sbin/ipsec/ipsecadm/xf_ahhmacsha1.c index 11ae5f1184d..fae18dc3b96 100644 --- a/sbin/ipsec/ipsecadm/xf_ahhmacsha1.c +++ b/sbin/ipsec/ipsecadm/xf_ahhmacsha1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xf_ahhmacsha1.c,v 1.1 1997/03/01 15:08:26 provos Exp $ */ +/* $OpenBSD: xf_ahhmacsha1.c,v 1.2 1997/04/14 10:04:29 provos Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, * (except when noted otherwise). @@ -77,7 +77,7 @@ char **argv; em->em_msglen = EMT_SETSPI_FLEN + 4 + AHHMACSHA1_KMAX; em->em_version = 0; em->em_type = EMT_SETSPI; - em->em_spi = htonl(strtol(argv[2], NULL, 16)); + em->em_spi = htonl(strtoul(argv[2], NULL, 16)); em->em_if = 1; em->em_dst.s_addr = inet_addr(argv[1]); em->em_alg = XF_AHHMACSHA1; diff --git a/sbin/ipsec/ipsecadm/xf_ahmd5.c b/sbin/ipsec/ipsecadm/xf_ahmd5.c index 4a854778dfe..be0b3e24d09 100644 --- a/sbin/ipsec/ipsecadm/xf_ahmd5.c +++ b/sbin/ipsec/ipsecadm/xf_ahmd5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xf_ahmd5.c,v 1.1 1997/03/01 15:08:26 provos Exp $ */ +/* $OpenBSD: xf_ahmd5.c,v 1.2 1997/04/14 10:04:29 provos Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, * (except when noted otherwise). @@ -77,7 +77,7 @@ char **argv; em->em_msglen = EMT_SETSPI_FLEN + 4 + klen; em->em_version = 0; em->em_type = EMT_SETSPI; - em->em_spi = htonl(strtol(argv[2], NULL, 16)); + em->em_spi = htonl(strtoul(argv[2], NULL, 16)); em->em_if = 1; em->em_dst.s_addr = inet_addr(argv[1]); em->em_alg = XF_AHMD5; diff --git a/sbin/ipsec/ipsecadm/xf_delspi.c b/sbin/ipsec/ipsecadm/xf_delspi.c index 4dd25bbbcc3..132386b3dcc 100644 --- a/sbin/ipsec/ipsecadm/xf_delspi.c +++ b/sbin/ipsec/ipsecadm/xf_delspi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xf_delspi.c,v 1.1 1997/03/01 15:08:27 provos Exp $ */ +/* $OpenBSD: xf_delspi.c,v 1.2 1997/04/14 10:04:30 provos Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, * (except when noted otherwise). @@ -79,7 +79,7 @@ char **argv; em->em_type = EMT_DELSPICHAIN; else em->em_type = EMT_DELSPI; - em->em_spi = htonl(strtol(argv[2], NULL, 16)); + em->em_spi = htonl(strtoul(argv[2], NULL, 16)); em->em_if = 1; em->em_dst.s_addr = inet_addr(argv[1]); em->em_alg = atoi(argv[4]); /* sanity checking in the kernel */ diff --git a/sbin/ipsec/ipsecadm/xf_esp3desmd5.c b/sbin/ipsec/ipsecadm/xf_esp3desmd5.c index 27716da4a8f..489f6bd6370 100644 --- a/sbin/ipsec/ipsecadm/xf_esp3desmd5.c +++ b/sbin/ipsec/ipsecadm/xf_esp3desmd5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xf_esp3desmd5.c,v 1.1 1997/03/01 15:08:27 provos Exp $ */ +/* $OpenBSD: xf_esp3desmd5.c,v 1.2 1997/04/14 10:04:31 provos Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, * (except when noted otherwise). @@ -75,7 +75,7 @@ char **argv; em->em_msglen = EMT_SETSPI_FLEN + ESP3DESMD5_ULENGTH; em->em_version = 0; em->em_type = EMT_SETSPI; - em->em_spi = htonl(strtol(argv[2], NULL, 16)); + em->em_spi = htonl(strtoul(argv[2], NULL, 16)); em->em_if = 1; em->em_dst.s_addr = inet_addr(argv[1]); em->em_alg = XF_ESP3DESMD5; diff --git a/sbin/ipsec/ipsecadm/xf_espdes.c b/sbin/ipsec/ipsecadm/xf_espdes.c index cc71834b99c..f3aabd5681e 100644 --- a/sbin/ipsec/ipsecadm/xf_espdes.c +++ b/sbin/ipsec/ipsecadm/xf_espdes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xf_espdes.c,v 1.1 1997/03/01 15:08:28 provos Exp $ */ +/* $OpenBSD: xf_espdes.c,v 1.2 1997/04/14 10:04:32 provos Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, * (except when noted otherwise). @@ -75,7 +75,7 @@ char **argv; em->em_msglen = EMT_SETSPI_FLEN + ESP_ULENGTH; em->em_version = 0; em->em_type = EMT_SETSPI; - em->em_spi = htonl(strtol(argv[2], NULL, 16)); + em->em_spi = htonl(strtoul(argv[2], NULL, 16)); em->em_if = 1; em->em_dst.s_addr = inet_addr(argv[1]); em->em_alg = XF_ESPDES; diff --git a/sbin/ipsec/ipsecadm/xf_espdesmd5.c b/sbin/ipsec/ipsecadm/xf_espdesmd5.c index 6502e606c18..1356ff2bd14 100644 --- a/sbin/ipsec/ipsecadm/xf_espdesmd5.c +++ b/sbin/ipsec/ipsecadm/xf_espdesmd5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xf_espdesmd5.c,v 1.1 1997/03/01 15:08:28 provos Exp $ */ +/* $OpenBSD: xf_espdesmd5.c,v 1.2 1997/04/14 10:04:32 provos Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, * (except when noted otherwise). @@ -75,7 +75,7 @@ char **argv; em->em_msglen = EMT_SETSPI_FLEN + ESPDESMD5_ULENGTH; em->em_version = 0; em->em_type = EMT_SETSPI; - em->em_spi = htonl(strtol(argv[2], NULL, 16)); + em->em_spi = htonl(strtoul(argv[2], NULL, 16)); em->em_if = 1; em->em_dst.s_addr = inet_addr(argv[1]); em->em_alg = XF_ESPDESMD5; diff --git a/sbin/ipsec/ipsecadm/xf_grp.c b/sbin/ipsec/ipsecadm/xf_grp.c index 4062079262b..b46a90712dd 100644 --- a/sbin/ipsec/ipsecadm/xf_grp.c +++ b/sbin/ipsec/ipsecadm/xf_grp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xf_grp.c,v 1.1 1997/03/01 15:08:28 provos Exp $ */ +/* $OpenBSD: xf_grp.c,v 1.2 1997/04/14 10:04:33 provos Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, * (except when noted otherwise). @@ -79,16 +79,16 @@ char **argv; switch (nspis) { case 4: - em->em_rel[3].emr_spi = htonl(strtol(argv[8], NULL, 16)); + em->em_rel[3].emr_spi = htonl(strtoul(argv[8], NULL, 16)); em->em_rel[3].emr_dst.s_addr = inet_addr(argv[7]); case 3: - em->em_rel[2].emr_spi = htonl(strtol(argv[6], NULL, 16)); + em->em_rel[2].emr_spi = htonl(strtoul(argv[6], NULL, 16)); em->em_rel[2].emr_dst.s_addr = inet_addr(argv[5]); case 2: - em->em_rel[1].emr_spi = htonl(strtol(argv[4], NULL, 16)); + em->em_rel[1].emr_spi = htonl(strtoul(argv[4], NULL, 16)); em->em_rel[1].emr_dst.s_addr = inet_addr(argv[3]); case 1: - em->em_rel[0].emr_spi = htonl(strtol(argv[2], NULL, 16)); + em->em_rel[0].emr_spi = htonl(strtoul(argv[2], NULL, 16)); em->em_rel[0].emr_dst.s_addr = inet_addr(argv[1]); break; } diff --git a/sbin/ipsec/ipsecadm/xf_ip4.c b/sbin/ipsec/ipsecadm/xf_ip4.c index 20a41a2f5b3..d077817c24f 100644 --- a/sbin/ipsec/ipsecadm/xf_ip4.c +++ b/sbin/ipsec/ipsecadm/xf_ip4.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xf_ip4.c,v 1.1 1997/03/01 15:08:29 provos Exp $ */ +/* $OpenBSD: xf_ip4.c,v 1.2 1997/04/14 10:04:34 provos Exp $ */ /* * The author of this code is John Ioannidis, ji@tla.org, * (except when noted otherwise). @@ -73,7 +73,7 @@ char **argv; em->em_msglen = EMT_SETSPI_FLEN + sizeof(struct ip4_xencap); em->em_version = 0; em->em_type = EMT_SETSPI; - em->em_spi = htonl(strtol(argv[2], NULL, 16)); + em->em_spi = htonl(strtoul(argv[2], NULL, 16)); em->em_if = 1; em->em_dst.s_addr = inet_addr(argv[1]); em->em_alg = XF_IP4; diff --git a/sbin/ipsec/rt/rt.c b/sbin/ipsec/rt/rt.c index 0eda804da72..14f27402b8a 100644 --- a/sbin/ipsec/rt/rt.c +++ b/sbin/ipsec/rt/rt.c @@ -135,7 +135,7 @@ char **argv; gw->sen_type = SENT_IPSP; gw->sen_ipsp_src.s_addr = inet_addr(argv[5]); gw->sen_ipsp_dst.s_addr = inet_addr(argv[6]); - gw->sen_ipsp_spi = htonl(strtol(argv[7], NULL, 16)); + gw->sen_ipsp_spi = htonl(strtoul(argv[7], NULL, 16)); gw->sen_ipsp_ifn = atoi(argv[8]); /* diff --git a/sbin/ipsec/rtdelete/rtdelete.c b/sbin/ipsec/rtdelete/rtdelete.c index 5e4bf53028d..4ee2e83cdac 100644 --- a/sbin/ipsec/rtdelete/rtdelete.c +++ b/sbin/ipsec/rtdelete/rtdelete.c @@ -135,7 +135,7 @@ char **argv; gw->sen_type = SENT_IPSP; gw->sen_ipsp_src.s_addr = inet_addr(argv[5]); gw->sen_ipsp_dst.s_addr = inet_addr(argv[6]); - gw->sen_ipsp_spi = htonl(strtol(argv[7], NULL, 16)); + gw->sen_ipsp_spi = htonl(strtoul(argv[7], NULL, 16)); gw->sen_ipsp_ifn = atoi(argv[8]); /* diff --git a/sbin/ipsec/sah/sah.c b/sbin/ipsec/sah/sah.c index 75a4b25cdc0..d7ef6dbdc6d 100644 --- a/sbin/ipsec/sah/sah.c +++ b/sbin/ipsec/sah/sah.c @@ -62,7 +62,7 @@ int x2i(char *s) ss[1] = s[1]; ss[2] = 0; - return strtol(ss, NULL, 16); + return strtoul(ss, NULL, 16); } @@ -91,7 +91,7 @@ char **argv; em->em_msglen = EMT_SETSPI_FLEN + 4 + klen; em->em_version = 0; em->em_type = EMT_SETSPI; - em->em_spi = htonl(strtol(argv[2], NULL, 16)); + em->em_spi = htonl(strtoul(argv[2], NULL, 16)); em->em_if = 1; em->em_dst.s_addr = inet_addr(argv[1]); em->em_alg = XF_AHMD5; diff --git a/sbin/ipsec/sahhmac/sahhmac.c b/sbin/ipsec/sahhmac/sahhmac.c index a0d0f15348c..391eefccbe6 100644 --- a/sbin/ipsec/sahhmac/sahhmac.c +++ b/sbin/ipsec/sahhmac/sahhmac.c @@ -62,7 +62,7 @@ int x2i(char *s) ss[1] = s[1]; ss[2] = 0; - return strtol(ss, NULL, 16); + return strtoul(ss, NULL, 16); } @@ -91,7 +91,7 @@ char **argv; em->em_msglen = EMT_SETSPI_FLEN + 4 + AHHMACMD5_KMAX; em->em_version = 0; em->em_type = EMT_SETSPI; - em->em_spi = htonl(strtol(argv[2], NULL, 16)); + em->em_spi = htonl(strtoul(argv[2], NULL, 16)); em->em_if = 1; em->em_dst.s_addr = inet_addr(argv[1]); em->em_alg = XF_AHHMACMD5; diff --git a/sbin/ipsec/sesp/sesp.c b/sbin/ipsec/sesp/sesp.c index cf130f36568..2adff69fff7 100644 --- a/sbin/ipsec/sesp/sesp.c +++ b/sbin/ipsec/sesp/sesp.c @@ -62,7 +62,7 @@ int x2i(char *s) ss[1] = s[1]; ss[2] = 0; - return strtol(ss, NULL, 16); + return strtoul(ss, NULL, 16); } @@ -89,7 +89,7 @@ char **argv; em->em_msglen = EMT_SETSPI_FLEN + ESP_ULENGTH; em->em_version = 0; em->em_type = EMT_SETSPI; - em->em_spi = htonl(strtol(argv[2], NULL, 16)); + em->em_spi = htonl(strtoul(argv[2], NULL, 16)); em->em_if = 1; em->em_dst.s_addr = inet_addr(argv[1]); em->em_alg = XF_ESPDES; diff --git a/sbin/ipsec/sesp3md5/sesp3md5.c b/sbin/ipsec/sesp3md5/sesp3md5.c index 08fa99ce229..61eac67d3e8 100644 --- a/sbin/ipsec/sesp3md5/sesp3md5.c +++ b/sbin/ipsec/sesp3md5/sesp3md5.c @@ -62,7 +62,7 @@ int x2i(char *s) ss[1] = s[1]; ss[2] = 0; - return strtol(ss, NULL, 16); + return strtoul(ss, NULL, 16); } @@ -89,7 +89,7 @@ char **argv; em->em_msglen = EMT_SETSPI_FLEN + ESP3DESMD5_ULENGTH; em->em_version = 0; em->em_type = EMT_SETSPI; - em->em_spi = htonl(strtol(argv[2], NULL, 16)); + em->em_spi = htonl(strtoul(argv[2], NULL, 16)); em->em_if = 1; em->em_dst.s_addr = inet_addr(argv[1]); em->em_alg = XF_ESP3DESMD5; diff --git a/sbin/ipsec/sespmd5/sespmd5.c b/sbin/ipsec/sespmd5/sespmd5.c index 88dee40480d..a255cf20961 100644 --- a/sbin/ipsec/sespmd5/sespmd5.c +++ b/sbin/ipsec/sespmd5/sespmd5.c @@ -62,7 +62,7 @@ int x2i(char *s) ss[1] = s[1]; ss[2] = 0; - return strtol(ss, NULL, 16); + return strtoul(ss, NULL, 16); } @@ -89,7 +89,7 @@ char **argv; em->em_msglen = EMT_SETSPI_FLEN + ESPDESMD5_ULENGTH; em->em_version = 0; em->em_type = EMT_SETSPI; - em->em_spi = htonl(strtol(argv[2], NULL, 16)); + em->em_spi = htonl(strtoul(argv[2], NULL, 16)); em->em_if = 1; em->em_dst.s_addr = inet_addr(argv[1]); em->em_alg = XF_ESPDESMD5; diff --git a/sbin/ipsec/sgrp/sgrp.c b/sbin/ipsec/sgrp/sgrp.c index 7ab99e47c8d..848680ca507 100644 --- a/sbin/ipsec/sgrp/sgrp.c +++ b/sbin/ipsec/sgrp/sgrp.c @@ -83,16 +83,16 @@ char **argv; switch (nspis) { case 4: - em->em_rel[3].emr_spi = htonl(strtol(argv[8], NULL, 16)); + em->em_rel[3].emr_spi = htonl(strtoul(argv[8], NULL, 16)); em->em_rel[3].emr_dst.s_addr = inet_addr(argv[7]); case 3: - em->em_rel[2].emr_spi = htonl(strtol(argv[6], NULL, 16)); + em->em_rel[2].emr_spi = htonl(strtoul(argv[6], NULL, 16)); em->em_rel[2].emr_dst.s_addr = inet_addr(argv[5]); case 2: - em->em_rel[1].emr_spi = htonl(strtol(argv[4], NULL, 16)); + em->em_rel[1].emr_spi = htonl(strtoul(argv[4], NULL, 16)); em->em_rel[1].emr_dst.s_addr = inet_addr(argv[3]); case 1: - em->em_rel[0].emr_spi = htonl(strtol(argv[2], NULL, 16)); + em->em_rel[0].emr_spi = htonl(strtoul(argv[2], NULL, 16)); em->em_rel[0].emr_dst.s_addr = inet_addr(argv[1]); break; } diff --git a/sbin/ipsec/shahmac/shahmac.c b/sbin/ipsec/shahmac/shahmac.c index 4ca68d2aaee..1dbec2ccd35 100644 --- a/sbin/ipsec/shahmac/shahmac.c +++ b/sbin/ipsec/shahmac/shahmac.c @@ -62,7 +62,7 @@ int x2i(char *s) ss[1] = s[1]; ss[2] = 0; - return strtol(ss, NULL, 16); + return strtoul(ss, NULL, 16); } @@ -91,7 +91,7 @@ char **argv; em->em_msglen = EMT_SETSPI_FLEN + 4 + AHHMACSHA1_KMAX; em->em_version = 0; em->em_type = EMT_SETSPI; - em->em_spi = htonl(strtol(argv[2], NULL, 16)); + em->em_spi = htonl(strtoul(argv[2], NULL, 16)); em->em_if = 1; em->em_dst.s_addr = inet_addr(argv[1]); em->em_alg = XF_AHHMACSHA1; diff --git a/sbin/ipsec/si4/si4.c b/sbin/ipsec/si4/si4.c index ae111b79723..0b8f1ba30fa 100644 --- a/sbin/ipsec/si4/si4.c +++ b/sbin/ipsec/si4/si4.c @@ -78,7 +78,7 @@ char **argv; em->em_msglen = EMT_SETSPI_FLEN + sizeof(struct ip4_xencap); em->em_version = 0; em->em_type = EMT_SETSPI; - em->em_spi = htonl(strtol(argv[2], NULL, 16)); + em->em_spi = htonl(strtoul(argv[2], NULL, 16)); em->em_if = 1; em->em_dst.s_addr = inet_addr(argv[1]); em->em_alg = XF_IP4;