Files
luban-lite/bsp/common/utils/aic_string.c
刘可亮 6e36e8e296 v1.2.0
2025-04-23 17:54:31 +08:00

22 lines
371 B
C

/*
* Copyright (c) 2025, ArtInChip Technology Co., Ltd
*
* SPDX-License-Identifier: Apache-2.0
*
* Authors: matteo <duanmt@artinchip.com>
*/
#include <stdlib.h>
#include <string.h>
long long int str2int(char *str)
{
if (str == NULL)
return 0;
if (strncmp(str, "0x", 2))
return atoi(str);
else
return strtoll(str, NULL, 16);
}