📄 strncpy.c
字号:
/* $Header: /usr/cvsroot/target/src/wrn/wm/common/lib/strncpy.c,v 1.3 2003/01/16 18:18:57 josh Exp $ *//* * Copyright (C) 1999-2005 Wind River Systems, Inc. * All rights reserved. Provided under license only. * Distribution or other use of this software is only * permitted pursuant to the terms of a license agreement * from Wind River Systems (and is otherwise prohibited). * Refer to that license agreement for terms of use. *//**************************************************************************** * All rights reserved. ****************************************************************************//* * $Log: strncpy.c,v $ * Revision 1.3 2003/01/16 18:18:57 josh * directory structure shifting * * Revision 1.2 2001/11/06 22:15:54 tneale * Fixed for newest file layout * * Revision 1.1.1.1 2001/11/05 17:48:40 tneale * Tornado shuffle * * Revision 1.3 2001/02/09 21:23:58 paul * Return dst (duh). * * Revision 1.2 2001/02/09 20:16:42 paul * Fixed Header line. * * Revision 1.1 2001/02/09 20:13:42 paul * Our own version of strncpy(), just in case the user doesn't have one. * *//* [clearcase]modification history-------------------01b,20apr05,job update copyright notices01a,11dec03,job fix copyright statements*/#include <wrn/wm/common/install.h>#include <wrn/wm/common/stdf.h>char *etc_strncpy(char *dst, const char *src, size_t n){ char *ret = dst; for ( ; (n > 0) && ((*dst++ = *src++) != '\0'); --n) { } for ( ; n > 0; --n) { *dst++ = '\0'; } return ret;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -