From 2ebd72b1947972dd5a529c836175630bd4e3c726 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Wed, 1 Oct 2008 12:39:59 +0000 Subject: [PATCH] sprintf -> snprintf. malloc.h ain't no standard header. Removed non-haiku code git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27820 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/bus_managers/acpi/acpi_device.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/add-ons/kernel/bus_managers/acpi/acpi_device.c b/src/add-ons/kernel/bus_managers/acpi/acpi_device.c index ddcea4836b..994fd910c0 100644 --- a/src/add-ons/kernel/bus_managers/acpi/acpi_device.c +++ b/src/add-ons/kernel/bus_managers/acpi/acpi_device.c @@ -4,9 +4,9 @@ * Distributed under the terms of the MIT License. */ -#include #include #include +#include #include "acpi_priv.h" @@ -30,7 +30,7 @@ static status_t acpi_get_object(acpi_device device, const char *path, acpi_object_type **return_value) { char objname[255]; - sprintf(objname, "%s.%s", device->path, path); + snprintf(objname, sizeof(objname), "%s.%s", device->path, path); return get_object(objname, return_value); } @@ -66,14 +66,8 @@ acpi_device_init_driver(device_node *node, void **cookie) device->type = type; device->node = node; -#ifdef __HAIKU__ snprintf(device->name, sizeof(device->name), "acpi_device %s", path); -#else - strncpy(device->name, "acpi_device ", sizeof(device->name) - 1); - strncat(device->name, path, sizeof(device->name) - 1); - device->name[sizeof(device->name) - 1] = '\0'; -#endif *cookie = device;