]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
inet_pton.c: Fixed compilation warnings
authorSteve Holme <steve_holme@hotmail.com>
Sun, 20 Mar 2016 11:14:58 +0000 (11:14 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Sun, 20 Mar 2016 11:14:58 +0000 (11:14 +0000)
warning: conversion to 'unsigned char' from 'int' may alter its value

lib/inet_pton.c

index 7d4714db7842987480a457e332b68d7058b98166..cf8b88a1d04dc29864707a1406782aec412206d5 100644 (file)
@@ -188,7 +188,7 @@ inet_pton6(const char *src, unsigned char *dst)
       }
       if(tp + INT16SZ > endp)
         return (0);
-      *tp++ = (unsigned char) (val >> 8) & 0xff;
+      *tp++ = (unsigned char) ((val >> 8) & 0xff);
       *tp++ = (unsigned char) (val & 0xff);
       saw_xdigit = 0;
       val = 0;
@@ -205,7 +205,7 @@ inet_pton6(const char *src, unsigned char *dst)
   if(saw_xdigit) {
     if(tp + INT16SZ > endp)
       return (0);
-    *tp++ = (unsigned char) (val >> 8) & 0xff;
+    *tp++ = (unsigned char) ((val >> 8) & 0xff);
     *tp++ = (unsigned char) (val & 0xff);
   }
   if(colonp != NULL) {