diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-08-09 17:24:16 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-08-09 17:24:16 -0700 |
commit | 95cb4dcd618774b3f7b5b915c5ce5aa72f853b53 (patch) | |
tree | 5855871af9beca9549fe978bac71434e53f3828f /src/sm_genid.c | |
parent | 5a06ff257f72a629539f23b35026fbcdb8bb372e (diff) |
Fix some clang warnings about integer size/sign conversions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/sm_genid.c')
-rw-r--r-- | src/sm_genid.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sm_genid.c b/src/sm_genid.c index ef7acae..bcd10a6 100644 --- a/src/sm_genid.c +++ b/src/sm_genid.c @@ -149,7 +149,7 @@ SmsGenerateClientID(SmsConn smsConn) char* inet_addr; char *ptr1; unsigned char decimal[4]; - int i, len; + int i; struct in_addr *haddr = NULL; # if defined(IPv6) && defined(AF_INET6) struct addrinfo *ai, *first_ai; @@ -202,8 +202,8 @@ SmsGenerateClientID(SmsConn smsConn) { char temp4[4]; char *ptr2 = strchr (ptr1, '.'); + size_t len = (size_t) (ptr2 - ptr1); - len = ptr2 - ptr1; if (!ptr2 || len > 3) { # if defined(IPv6) && defined(AF_INET6) freeaddrinfo(first_ai); @@ -212,11 +212,11 @@ SmsGenerateClientID(SmsConn smsConn) } strncpy (temp4, ptr1, len); temp4[len] = '\0'; - decimal[i] = atoi (temp4); + decimal[i] = (unsigned char) atoi (temp4); ptr1 = ptr2 + 1; } - decimal[3] = atoi (ptr1); + decimal[3] = (unsigned char) atoi (ptr1); *addr_ptr++ = '1'; |