Imported Upstream version 58.1
[platform/upstream/icu.git] / source / tools / toolutil / unewdata.c
index 9ea60d5..0fb9d43 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 *******************************************************************************
 *
@@ -39,7 +41,7 @@ udata_create(const char *dir, const char *type, const char *name,
     uint16_t headerSize, commentLength;
     char filename[512];
     uint8_t bytes[16];
-    int length;
+    int32_t length;
 
     if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {
         return NULL;
@@ -74,7 +76,7 @@ udata_create(const char *dir, const char *type, const char *name,
 
         
      /* LDH buffer Length error check */
-    if(length  > (sizeof(filename) - 1))
+    if(length  > ((int32_t)sizeof(filename) - 1))
     {
            *pErrorCode = U_BUFFER_OVERFLOW_ERROR;
            uprv_free(pData);