diff --git a/common/device/drv_device.c b/common/device/drv_device.c index 08aee85d..e02a8371 100644 --- a/common/device/drv_device.c +++ b/common/device/drv_device.c @@ -66,7 +66,7 @@ int device_register(struct device *dev, const char *name) } } - strncpy(dev->name, name, DEVICE_NAME_MAX); + strcpy(dev->name, name); dlist_insert_after(&device_head, &(dev->list)); dev->status = DEVICE_REGISTERED; diff --git a/common/memheap/drv_mmheap.c b/common/memheap/drv_mmheap.c index cc05589f..7369b7c5 100644 --- a/common/memheap/drv_mmheap.c +++ b/common/memheap/drv_mmheap.c @@ -27,7 +27,7 @@ #define MEM_MANAGE_BITS_PER_BYTE 8 #define MEM_MANAGE_MEM_STRUCT_SIZE mmheap_align_up(sizeof(struct heap_node), MEM_MANAGE_ALIGNMENT_BYTE_DEFAULT) #define MEM_MANAGE_MINUM_MEM_SIZE (MEM_MANAGE_MEM_STRUCT_SIZE << 1) -#define MEM_MANAGE_ALLOCA_LABAL ((size_t)(1 << (sizeof(size_t) * MEM_MANAGE_BITS_PER_BYTE - 1))) +#define MEM_MANAGE_ALLOCA_LABAL ((size_t)((size_t)1 << (sizeof(size_t) * MEM_MANAGE_BITS_PER_BYTE - 1))) static inline size_t mmheap_align_down(size_t data, size_t align_byte) {