Line 0
Link Here
|
0 |
- |
1 |
Portability fixes: |
|
|
2 |
|
3 |
- Initialize outbuf with the expected size! fixes a segfault with musl. |
4 |
- Really use __builtin_va_arg_pack_len(). |
5 |
|
6 |
--- a/src/efivar.h |
7 |
+++ b/src/efivar.h |
8 |
@@ -85,7 +85,7 @@ efi_set_variable(efi_guid_t guid, const char *name, |
9 |
return -1; |
10 |
} |
11 |
|
12 |
- if (__va_arg_pack_len() == 0) |
13 |
+ if (__builtin_va_arg_pack_len() == 0) |
14 |
return _efi_set_variable(guid, name, data, data_size, |
15 |
attributes, 0644); |
16 |
|
17 |
diff --git a/src/makeguids.c b/src/makeguids.c |
18 |
index 321a7e7..7d68b8a 100644 |
19 |
--- a/src/makeguids.c |
20 |
+++ b/src/makeguids.c |
21 |
@@ -100,7 +100,7 @@ main(int argc, char *argv[]) |
22 |
err(1, "makeguids: could not read \"%s\"", argv[1]); |
23 |
|
24 |
/* strictly speaking, this *has* to be too large. */ |
25 |
- struct guidname *outbuf = calloc(inlen, sizeof (char)); |
26 |
+ struct guidname *outbuf = calloc(inlen, sizeof (struct guidname)); |
27 |
if (!outbuf) |
28 |
err(1, "makeguids"); |
29 |
|