Merge tag 'dm-pull-9jul19-take2' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
[oweals/u-boot.git] / tools / binman / etype / fill.py
index 7210a8324a0a6168460bf327ba1d85a0b4819292..68efe42ec0b383e9307140ae0963e53ca0aee657 100644 (file)
@@ -5,7 +5,7 @@
 
 from entry import Entry
 import fdt_util
-
+import tools
 
 class Entry_fill(Entry):
     """An entry which is filled to a particular byte value
@@ -23,10 +23,10 @@ class Entry_fill(Entry):
     """
     def __init__(self, section, etype, node):
         Entry.__init__(self, section, etype, node)
-        if not self.size:
+        if self.size is None:
             self.Raise("'fill' entry must have a size property")
         self.fill_value = fdt_util.GetByte(self._node, 'fill-byte', 0)
 
     def ObtainContents(self):
-        self.SetContents(chr(self.fill_value) * self.size)
+        self.SetContents(tools.GetBytes(self.fill_value, self.size))
         return True