Skip to content

Conversation

@mike-jumper
Copy link
Contributor

This change adds platform-independent libguac implementations of the strlcpy() and strlcat() functions, guac_strlcpy() and guac_strlcat(), provided via a new guacamole/string.h header. These functions will use the versions provided by the platform's libc, if available.

Unlike strncpy() and strncat(), the strlcpy() and strlcat() variants guarantee that the destination buffer is null-terminated, even if the result had to be truncated: https://www.freebsd.org/cgi/man.cgi?query=strlcpy&sektion=3&manpath=FreeBSD+6.2-RELEASE

This change also adds a similar convenience function, guac_strljoin(), which provides an implementation of the familiar "join" operation for strings.

Unit tests have been added for each of the new functions.

@necouchman necouchman changed the base branch from master to staging/1.1.0 February 22, 2019 10:09
@necouchman
Copy link
Contributor

Changed merge base to staging/1.1.0 as this is slated to go into release 1.1.0.

@jmuehlner
Copy link
Contributor

Ok, I think everything looks good now.

@asfgit asfgit merged commit f8ec709 into apache:staging/1.1.0 Apr 10, 2019
@mike-jumper mike-jumper deleted the string-functions branch April 10, 2019 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants