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
This commit is contained in:
@@ -4,9 +4,9 @@
|
|||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <malloc.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "acpi_priv.h"
|
#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)
|
acpi_get_object(acpi_device device, const char *path, acpi_object_type **return_value)
|
||||||
{
|
{
|
||||||
char objname[255];
|
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);
|
return get_object(objname, return_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,14 +66,8 @@ acpi_device_init_driver(device_node *node, void **cookie)
|
|||||||
device->type = type;
|
device->type = type;
|
||||||
device->node = node;
|
device->node = node;
|
||||||
|
|
||||||
#ifdef __HAIKU__
|
|
||||||
snprintf(device->name, sizeof(device->name), "acpi_device %s",
|
snprintf(device->name, sizeof(device->name), "acpi_device %s",
|
||||||
path);
|
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;
|
*cookie = device;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user