• The function strncpy (3) can also be used to copy only a part of the source string into the destination.

    函数strncpy(3)可以用来字符串一部分复制目标中。

    youdao

  • Both strncpy (3) and strncat (3) require that you give the amount of space left, not the total size of the buffer.

    strncpy(3)strncat(3)都要求给出剩余空间而不是给出缓冲区大小

    youdao

  • The correct way to do this would be to use the strncpy function instead of strcpy , and give the maximum number of bytes to copy as BUFSIZ - 1.

    复制正确方法strncpy函数代替strcpy将要复制的最大字节数定为BUFSIZ-1

    youdao

  • The function strncpy(3) also doesn't NUL-terminate its destination if the source string is at least as long as the destination; this can cause havoc later.

    如果字符串至少目标一样,那么函数strncpy(3)不会使用NUL 来结束字符串;可能会在以后导致严重破坏

    youdao

  • This means that switching from strcpy (3) to strncpy (3) can reduce performanceoften not a serious problem on today's computers, but it can still be a nuisance.

    意味着strcpy(3)切换strncpy(3)降低性能——这如今计算机上通常不是一个严重问题仍然有害的。

    youdao

  • Memcpy joins the ranks of other popular functions like strcpy, strncpy, strcat, strncat which were banned due to their security vulnerability through buffer overruns.

    memcpy加入到strcpy,strncpy,strcat,strncat常用函数队伍中,都是由于通过缓存溢出进行安全攻击而被禁用

    youdao

  • Then, we'll discuss two examples of the static approach (standard C strncpy/strncat and OpenBSD's strlcpy/strlcat), followed by two examples of the dynamic approach (SafeStr and C++'s std::string).

    然后我们讨论静态方法例子标准Cstrncpy/strncatOpenBSDstrlcpy/strlcat ),接着讨论动态方法的两个例子(SafeStr 和 C++ 的std::string )。

    youdao

  • Then, we'll discuss two examples of the static approach (standard C strncpy/strncat and OpenBSD's strlcpy/strlcat), followed by two examples of the dynamic approach (SafeStr and C++'s std::string).

    然后我们讨论静态方法例子标准Cstrncpy/strncatOpenBSDstrlcpy/strlcat ),接着讨论动态方法的两个例子(SafeStr 和 C++ 的std::string )。

    youdao

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定