SHA256
1
0
forked from pool/s390-tools
s390-tools/s390-tools-sles12sp3-util_proc-fix-memory-allocation-error-messages.patch
2017-02-21 11:14:26 +00:00

31 lines
979 B
Diff

util_proc: Fix memory allocation error messages
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
---
libutil/util_proc.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--- a/libutil/util_proc.c
+++ b/libutil/util_proc.c
@@ -54,8 +54,7 @@ util_proc_read_special_file(const char *
count = 0;
data = (char *) malloc(current_size);
if (data == NULL) {
- printf("Could not allocate %lld bytes of memory",
- (unsigned long long) size);
+ printf("Could not allocate %zu bytes of memory", current_size);
fclose(file);
return -1;
}
@@ -69,8 +68,8 @@ util_proc_read_special_file(const char *
if (count >= current_size) {
new_data = (char *) malloc(current_size * 2);
if (new_data == NULL) {
- printf("Could not allocate %lld bytes of memory",
- (unsigned long long) size);
+ printf("Could not allocate %zu bytes of memory",
+ current_size * 2);
free(data);
fclose(file);
return -1;