faster since it does not have to look for '\0' Signed-off-by: Dominik Csapak <d.csa...@proxmox.com> --- src/mini-journalreader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/mini-journalreader.c b/src/mini-journalreader.c index 3be348e..d5c55fd 100644 --- a/src/mini-journalreader.c +++ b/src/mini-journalreader.c @@ -91,12 +91,12 @@ static void print_reboot(sd_journal *j) { static char bootid[32]; if (bootid[0] != '\0') { // we have some bootid - if (strncmp(bootid, d, l)) { // a new bootid found - strncpy(bootid, d, l); + if (memcmp(bootid, d, l)) { // a new bootid found + memcpy(bootid, d, l); print_to_buf("-- Reboot --\n", 13); } } else { - strncpy(bootid, d, l); + memcpy(bootid, d, l); } } -- 2.11.0 _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel