acpi NamespaceDump: "unsigned <= 0" comparison, better check of byte length

This commit is contained in:
Viktor Müntzing 2016-01-11 20:16:29 +01:00 committed by PulkoMandy
parent 81b134d33c
commit cc9a637eb0

View File

@ -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;