A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-July/127457.html below:

Use strncat() instead of strcat() to silence some warnings.

[Python-Dev] cpython: Use strncat() instead of strcat() to silence some warnings. [Python-Dev] cpython: Use strncat() instead of strcat() to silence some warnings.Christian Heimes christian at python.org
Sat Jul 20 15:29:45 CEST 2013
Am 20.07.2013 14:23, schrieb Serhiy Storchaka:
> This will wrong when strlen(fname) is 30. strncat() will copy only 30
> bytes, without terminal NUL.

http://linux.die.net/man/3/strncat

The strncat() function is similar, except that

* it will use at most n bytes from src; and

* src does not need to be null-terminated if it contains n or more bytes.

If src contains n or more bytes, strncat() writes n+1 bytes to dest (n
from src plus the terminating null byte). Therefore, the size of dest
must be at least strlen(dest)+n+1.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4