From cc9a637eb015451679d5880413cf0d90b31c4411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20M=C3=BCntzing?= Date: Mon, 11 Jan 2016 20:16:29 +0100 Subject: [PATCH] acpi NamespaceDump: "unsigned <= 0" comparison, better check of byte length --- src/add-ons/kernel/bus_managers/acpi/NamespaceDump.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/add-ons/kernel/bus_managers/acpi/NamespaceDump.cpp b/src/add-ons/kernel/bus_managers/acpi/NamespaceDump.cpp index b71ce4893b..f2fb5a1f1d 100644 --- a/src/add-ons/kernel/bus_managers/acpi/NamespaceDump.cpp +++ b/src/add-ons/kernel/bus_managers/acpi/NamespaceDump.cpp @@ -149,11 +149,11 @@ dump_acpi_namespace(acpi_ns_device_info *device, char *root, int indenting) RingBuffer &ringBuffer = *device->buffer; size_t toWrite = strlen(output); - if (toWrite <= 0) + if (toWrite == 0) break; - strlcat(output, "\n", sizeof(output)); - toWrite++; + toWrite = strlcat(output, "\n", sizeof(output)); + if (!ringBuffer.Lock()) break;