git.droids-corp.org
/
libcmdline.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cmdline (merge-intel): fix compilation with icc
[libcmdline.git]
/
src
/
lib
/
cmdline_parse_ipaddr.c
diff --git
a/src/lib/cmdline_parse_ipaddr.c
b/src/lib/cmdline_parse_ipaddr.c
index
2ffbf0c
..
276d644
100644
(file)
--- a/
src/lib/cmdline_parse_ipaddr.c
+++ b/
src/lib/cmdline_parse_ipaddr.c
@@
-108,8
+108,8
@@
struct cmdline_token_ops cmdline_token_ipaddr_ops = {
* sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
*/
* sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
*/
-static int inet_pton4(const char *src, u
_
char *dst);
-static int inet_pton6(const char *src, u
_
char *dst);
+static int inet_pton4(const char *src, u
nsigned
char *dst);
+static int inet_pton6(const char *src, u
nsigned
char *dst);
/* int
* inet_pton(af, src, dst)
/* int
* inet_pton(af, src, dst)
@@
-148,11
+148,11
@@
my_inet_pton(int af, const char *src, void *dst)
* Paul Vixie, 1996.
*/
static int
* Paul Vixie, 1996.
*/
static int
-inet_pton4(const char *src, u
_
char *dst)
+inet_pton4(const char *src, u
nsigned
char *dst)
{
static const char digits[] = "0123456789";
int saw_digit, octets, ch;
{
static const char digits[] = "0123456789";
int saw_digit, octets, ch;
- u
_
char tmp[INADDRSZ], *tp;
+ u
nsigned
char tmp[INADDRSZ], *tp;
saw_digit = 0;
octets = 0;
saw_digit = 0;
octets = 0;
@@
-161,7
+161,7
@@
inet_pton4(const char *src, u_char *dst)
const char *pch;
if ((pch = strchr(digits, ch)) != NULL) {
const char *pch;
if ((pch = strchr(digits, ch)) != NULL) {
- u
_
int new = *tp * 10 + (pch - digits);
+ u
nsigned
int new = *tp * 10 + (pch - digits);
if (new > 255)
return (0);
if (new > 255)
return (0);
@@
-170,7
+170,7
@@
inet_pton4(const char *src, u_char *dst)
return (0);
saw_digit = 1;
}
return (0);
saw_digit = 1;
}
- *tp = new;
+ *tp =
(unsigned char)
new;
} else if (ch == '.' && saw_digit) {
if (octets == 4)
return (0);
} else if (ch == '.' && saw_digit) {
if (octets == 4)
return (0);
@@
-200,14
+200,14
@@
inet_pton4(const char *src, u_char *dst)
* Paul Vixie, 1996.
*/
static int
* Paul Vixie, 1996.
*/
static int
-inet_pton6(const char *src, u
_
char *dst)
+inet_pton6(const char *src, u
nsigned
char *dst)
{
static const char xdigits_l[] = "0123456789abcdef",
xdigits_u[] = "0123456789ABCDEF";
{
static const char xdigits_l[] = "0123456789abcdef",
xdigits_u[] = "0123456789ABCDEF";
- u
_
char tmp[IN6ADDRSZ], *tp, *endp, *colonp;
+ u
nsigned
char tmp[IN6ADDRSZ], *tp, *endp, *colonp;
const char *xdigits, *curtok;
int ch, saw_xdigit, count_xdigit;
const char *xdigits, *curtok;
int ch, saw_xdigit, count_xdigit;
- u
_
int val;
+ u
nsigned
int val;
memset((tp = tmp), '\0', IN6ADDRSZ);
endp = tp + IN6ADDRSZ;
memset((tp = tmp), '\0', IN6ADDRSZ);
endp = tp + IN6ADDRSZ;
@@
-247,8
+247,8
@@
inet_pton6(const char *src, u_char *dst)
}
if (tp + sizeof(int16_t) > endp)
return (0);
}
if (tp + sizeof(int16_t) > endp)
return (0);
- *tp++ = (u
_char) (val >> 8) & 0xff
;
- *tp++ = (u
_char) val & 0xff
;
+ *tp++ = (u
nsigned char) ((val >> 8) & 0xff)
;
+ *tp++ = (u
nsigned char) (val & 0xff)
;
saw_xdigit = 0;
count_xdigit = 0;
val = 0;
saw_xdigit = 0;
count_xdigit = 0;
val = 0;
@@
-266,8
+266,8
@@
inet_pton6(const char *src, u_char *dst)
if (saw_xdigit) {
if (tp + sizeof(int16_t) > endp)
return (0);
if (saw_xdigit) {
if (tp + sizeof(int16_t) > endp)
return (0);
- *tp++ = (u
_char) (val >> 8) & 0xff
;
- *tp++ = (u
_char) val & 0xff
;
+ *tp++ = (u
nsigned char) ((val >> 8) & 0xff)
;
+ *tp++ = (u
nsigned char) (val & 0xff)
;
}
if (colonp != NULL) {
/*
}
if (colonp != NULL) {
/*