|
|
|
@ -107,9 +107,10 @@ char *strecat(char *dst, const char *src, const char *last)
|
|
|
|
|
* @param dst The destination buffer
|
|
|
|
|
* @param src The buffer containing the string to copy
|
|
|
|
|
* @param last The pointer to the last element of the destination buffer
|
|
|
|
|
* @param quiet_mode If set to true, emitted warning for truncating the input string is emitted at level 1 instead of 0
|
|
|
|
|
* @return The pointer to the terminating null-character in the destination buffer
|
|
|
|
|
*/
|
|
|
|
|
char *strecpy(char *dst, const char *src, const char *last)
|
|
|
|
|
char *strecpy(char *dst, const char *src, const char *last, bool quiet_mode)
|
|
|
|
|
{
|
|
|
|
|
assert(dst <= last);
|
|
|
|
|
while (dst != last && *src != '\0') {
|
|
|
|
@ -121,7 +122,7 @@ char *strecpy(char *dst, const char *src, const char *last)
|
|
|
|
|
#if defined(STRGEN) || defined(SETTINGSGEN)
|
|
|
|
|
error("String too long for destination buffer");
|
|
|
|
|
#else /* STRGEN || SETTINGSGEN */
|
|
|
|
|
DEBUG(misc, 0, "String too long for destination buffer");
|
|
|
|
|
DEBUG(misc, quiet_mode ? 1 : 0, "String too long for destination buffer");
|
|
|
|
|
#endif /* STRGEN || SETTINGSGEN */
|
|
|
|
|
}
|
|
|
|
|
return dst;
|
|
|
|
|