📄 string.c
字号:
/* * File : string.c * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2008, RT-Thread Development Team * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rt-thread.org/license/LICENSE * * Change Logs: * Date Author Notes * 2008-08-14 Bernard the first version */#include <rtthread.h>#if !defined (RT_USING_NEWLIB) && defined (RT_USING_MINILIBC)#include "string.h"/* there is no strcpy and strcmp implementation in RT-Thread */char *strcpy(char *dest, const char *src){ return rt_strncpy(dest, src, rt_strlen(src) + 1);}int strcmp (const char *s1, const char *s2){ while (*s1 && *s1 == *s2) s1++, s2++; return (*s1 - *s2);}#ifdef RT_USING_HEAPchar *strdup(const char *s){ size_t len = strlen(s) + 1; char *tmp = (char *)rt_malloc(len); if(!tmp) return NULL; rt_memcpy(tmp, s, len); return tmp;}#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -