Skip to content

Commit a3292d2

Browse files
committed
sdjournal: use C constant for SD_ID128_STRING_MAX
1 parent 9d9853f commit a3292d2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sdjournal/journal.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)