]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: (gpt) rmeove xalloc calls
authorKarel Zak <kzak@redhat.com>
Wed, 20 Mar 2013 13:46:03 +0000 (14:46 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 20 Mar 2013 13:46:03 +0000 (14:46 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/gpt.c

index 2c3f946678bf823f91e6b157d2124349cb7413f5..58ebdc688494ff62932341214ef91ebbb533d4d6 100644 (file)
@@ -37,7 +37,6 @@
 #include "fdiskP.h"
 
 #include "nls.h"
-#include "xalloc.h"
 #include "crc32.h"
 #include "blkdev.h"
 #include "bitops.h"
@@ -1076,10 +1075,12 @@ failed:
 static char *encode_to_utf8(unsigned char *src, size_t count)
 {
        uint16_t c;
-       char *dest = xmalloc(count * sizeof(char));
+       char *dest;
        size_t i, j, len = count;
 
-       memset(dest, 0, sizeof(char) * count);
+       dest = calloc(1, count);
+       if (!dest)
+               return NULL;
 
        for (j = i = 0; i + 2 <= count; i += 2) {
                /* always little endian */