forked from pool/s390-tools
Marcus Meissner
9b729e2acc
New package per "Factory first" policy. Please list me as bug owner and maintainer, if possible. OBS-URL: https://build.opensuse.org/request/show/459343 OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=1
31 lines
979 B
Diff
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;
|