Replace strncat(buf, str, strlen(str)) with strcat(buf, str). Using strlen(src) as the bound to strncat is pointless - it will always copy the entire source string, making it equivalent to strcat. This also triggers -Wstringop-overflow warnings on modern GCC. Similarly, strncat with literal strings and their exact length (e.g., strncat(buf, "==", 2)) is equivalent to strcat. |
||
|---|---|---|
| cde | ||