diff --git a/core/Universal_charstring.cc b/core/Universal_charstring.cc
index 6e8318042577f1686f896796614a7a6a41942741..a9b80634b74d7f3f85c0b81dc359710ccf23d27a 100644
--- a/core/Universal_charstring.cc
+++ b/core/Universal_charstring.cc
@@ -1613,10 +1613,9 @@ void UNIVERSAL_CHARSTRING::encode_utf16(TTCN_Buffer& buf,
         buf.put_c(isbig ? c : r);
       }
       else if (g || p) { // greater than 0xFFFF it needs surrogates
-        uint32_t univc = 0, temp = 0;
-        univc = g;
+        uint32_t univc = g;
         univc <<= 24;
-        temp = p;
+        uint32_t temp = p;
         temp <<= 16;
         univc |= temp;
         temp = r;