Skip to content

Commit 47c10f0

Browse files
author
Luca Bruno
authored
Merge pull request #358 from lucab/ups/sdjournal-conditional-static
sdjournal: drop conditional static specifier
2 parents ac4bfc1 + cb9eb60 commit 47c10f0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sdjournal/journal.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ package sdjournal
310310
// }
311311
//
312312
// char *
313-
// my_sd_id128_to_string(void *f, sd_id128_t boot_id, char s[_SD_ARRAY_STATIC SD_ID128_STRING_MAX])
313+
// my_sd_id128_to_string(void *f, sd_id128_t boot_id, char s[SD_ID128_STRING_MAX])
314314
// {
315315
// char *(*sd_id128_to_string)(sd_id128_t, char *);
316316
//
@@ -1155,7 +1155,8 @@ func (j *Journal) GetBootID() (string, error) {
11551155
return "", err
11561156
}
11571157

1158-
c := (*C.char)(C.malloc(33))
1158+
id128StringMax := C.ulong(C.SD_ID128_STRING_MAX)
1159+
c := (*C.char)(C.malloc(id128StringMax))
11591160
defer C.free(unsafe.Pointer(c))
11601161
C.my_sd_id128_to_string(sd_id128_to_string, boot_id, c)
11611162

0 commit comments

Comments
 (0)