Fix size used for memset in alloc_output_file
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 5 Mar 2013 15:18:20 +0000 (15:18 +0000)
committerJunfeng Dong <junfeng.dong@intel.com>
Tue, 19 Nov 2013 10:57:39 +0000 (18:57 +0800)
commitf5ec14808631699b99660728a00b5454ab4a545e
tree12634f04000fd8a25f0fbf812e18356022c2daa0
parentc880d3fbc86634f56cc5a0d41119212ce242dd5f
Fix size used for memset in alloc_output_file

The output->buf field is a pointer, not an array, so sizeof() is not
applicable.  We must use the allocated string length instead.

Identified by gcc:

  util/zbin.c: In function ‘alloc_output_file’:
  util/zbin.c:146:37: warning: argument to ‘sizeof’ in ‘memset’ call
    is the same expression as the destination; did you mean to
    dereference it? [-Wsizeof-pointer-memaccess]
  memset ( output->buf, 0xff, sizeof ( output->buf ) );

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
roms/ipxe/src/util/zbin.c