utils.cpp

来自「Amarok是一款在LINUX或其他类UNIX操作系统中运行的音频播放器软件。 」· C++ 代码 · 共 37 行

CPP
37
字号
/* * * This software is released under the provisions of the GPL version 2. * see file "COPYING".  If that file is not available, the full statement  * of the license can be found at * * http://www.fsf.org/licensing/licenses/gpl.txt * * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. * Portions (c) Paul Cifarelli 2005 */#include <stdio.h>#include <stdarg.h>#include <string.h>#include "utils.h"int SafeSprintf(char *str, int max, const char *fmt, ...){   int ret;   va_list ap;   va_start(ap, fmt);   ret = vsnprintf(str,max,fmt,ap);   va_end(ap);   return ret;}char *SafeStrCpy(char *str1, const char *str2, int sz){   int len = strlen(str2);   if (len > sz)      return 0;   return (strcpy(str1,str2));}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?