Serializing XML to a string or file is where lxml excels because it relies on libxml2 C code directly.
将XML序列化为一个字符串或文件是lxml 的长项,因为它依赖于libxml2C代码库。
For paths with a single element such as c, this routine returns an empty string.
对于包含单个元素的路径,如c,此例程将返回空字符串。
Enumerations and numeric ranges: For example, the value of a particular string attribute must be a, c, or D. Another example: the value of a particular numeric must be between 1 and 500.
枚举与数字范围:例如,某个特定字符串属性必须为A、c或者d。再比如,某个特定的数字必须在1至500之间。
In c, a common mistake is to pass attacker data into format string parameters (such as the first parameter of printf (3)).
在c语言中,一个常见的错误是将攻击者的数据传递到格式化字符串参数中(例如printf(3)的第一个参数)。
Using the standard C string functions or your favorite string library, compare the common name and the host name.
使用标准的C字符串函数或您习惯使用的字符串库对通用名和主机名进行比较。
Now we're not dealing with C and C arrays but also want to use string offsets so we need a function to calculate a numeric value, a hash, for each key.
现在我们处理的不是C语言和它的数组,我们想用字符串偏移量,所以我们需要一个哈希函数,为每个键值计算出一个数值。
So, if a string with an embedded NUL character is passed to a library using a C convention, the string will suddenly be "chopped off" at that first NUL.
因此,如果一个内嵌NUL字符的字符串被传递给使用C约定的库,那么这个字符串就会突然被从第一个 NUL 处截断了。
For example, the expression a*\|b*c will match a string consisting of any number of as or any number of bs (but not both) terminated by a single c.
例如,表达式 a*\|b*c匹配由任何数量的a或b 组成(但不是同时)且以一个 c 结尾的字符串。
Now we just need a program to convert our macro into standard C. For this simple example, Perl is used because it can evaluate user code in a string, and its syntax is largely C-like.
现在我们只需要一个程序将这个宏转换成标准的C 语言就可以了。对于这个简单的例子来说,我们将使用Perl 来实现这个程序,因为它可以对字符串中的用户代码进行评测,其语法也与 C 语言非常类似。
The following example is provided for those very rare situations in which you may want to modify a string in-place by using unsafe code in a manner similar to C-style char arrays.
下面的示例针对的是一种非常罕见的情况,即您可能希望使用不安全代码以类似于C 样式字符数组的方式就地修改字符串。
Returns a C-style character string that is a printable version of the type name. Type names are generated in a system-dependent way.
返回c风格字符串,这是类型名字的可显示版本。类型名字用系统相关的方法产生。
字符串字面值,比如a、b、c等等。
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/strncat和OpenBSD 的strlcpy/strlcat ),接着讨论动态方法的两个例子(SafeStr 和 C++ 的std::string )。
If the string-pooling option, [/GF], is enabled in Visual C++, then a single copy of the string is kept in the program image during execution and string1 equals string2.
如果在Visual C++ 中启用了字符串池选项 [/GF],那么在执行期间,将在程序的映像中仅保存该字符串的单个副本,且string1 与 string2 相等。
We feel it is a lack of uniformity that makes many existing C runtime string-handling functions susceptible to security errors, and the extra consistency in strsafe should help remedy the problem.
我们觉得,缺乏统一性是导致现有许多C 语言字符串处理函数容易产生安全漏洞的根本原因,而strsafe 系列函数所带来的高度统一性恰恰是解决此问题的一剂良药。
We feel it is a lack of uniformity that makes many existing C runtime string-handling functions susceptible to security errors, and the extra consistency in strsafe should help remedy the problem.
我们觉得,缺乏统一性是导致现有许多C 语言字符串处理函数容易产生安全漏洞的根本原因,而strsafe 系列函数所带来的高度统一性恰恰是解决此问题的一剂良药。
应用推荐