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/127458.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.Serhiy Storchaka storchaka at gmail.com
Sat Jul 20 15:56:25 CEST 2013
20.07.13 16:27, Christian Heimes написав(ла):
>> This will wrong when strlen(fname) is 30. strncat() will copy only 30
>> bytes, without terminal NUL.
>
> That's not how strncat() works. strncat(dest, src, n) writes n+1 chars
> to the end of dest: n chars from src and +1 for the final NUL char. For
> this reason dest must be large enough to hold strlen(dest) + n + 1 chars.

Oh, true. strncat() always results NUL-terminated string. It's strncpy() 
can produce not NUL-terminated string. Sorry for noise.

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