diff --git a/src/openvpn/httpdigest.c b/src/openvpn/httpdigest.c
index be20638..3e6520a 100644
--- a/src/openvpn/httpdigest.c
+++ b/src/openvpn/httpdigest.c
@@ -46,7 +46,7 @@
         }
         else
         {
-            Hex[i * 2] = (j + 'a' - 10);
+            Hex[i * 2] = (unsigned char)(j + 'a' - 10);
         }
         j = Bin[i] & 0xf;
         if (j <= 9)
@@ -55,7 +55,7 @@
         }
         else
         {
-            Hex[i * 2 + 1] = (j + 'a' - 10);
+            Hex[i * 2 + 1] = (unsigned char)(j + 'a' - 10);
         }
     }
     Hex[HASHHEXLEN] = '\0';
diff --git a/src/openvpn/mroute.c b/src/openvpn/mroute.c
index b50d48f..d17902f 100644
--- a/src/openvpn/mroute.c
+++ b/src/openvpn/mroute.c
@@ -337,7 +337,7 @@
             }
             else
             {
-                ma->v6.addr.s6_addr[byte--] &= (0xFF << bits_to_clear);
+                ma->v6.addr.s6_addr[byte--] &= (uint8_t)(0xFF << bits_to_clear);
                 bits_to_clear = 0;
             }
         }
