[1003.1(2008)/Issue 7 0000986]: Would it be worth investigating adding strlcpy(), strlcat(), wcslcpy() and wcslcat()?
The following issue has been set as RELATED TO issue 0001591. == https://austingroupbugs.net/view.php?id=986 == Reported By:EdSchouten Assigned To:ajosey == Project:1003.1(2008)/Issue 7 Issue ID: 986 Category: Base Definitions and Headers Type: Clarification Requested Severity: Editorial Priority: normal Status: Applied Name: Ed Schouten Organization: Nuxi User Reference: Section: and Page Number:n/a Line Number:n/a Interp Status: --- Final Accepted Text:https://austingroupbugs.net/view.php?id=986#c5334 Resolution: Accepted As Marked Fixed in Version: == Date Submitted: 2015-09-23 08:35 UTC Last Modified: 2021-05-07 15:18 UTC == Summary:Would it be worth investigating adding strlcpy(), strlcat(), wcslcpy() and wcslcat()? == Relationships ID Summary -- related to 0001591 Proposed strlcpy spec has problems == Issue History Date ModifiedUsername FieldChange == 2015-09-23 08:35 EdSchouten New Issue 2015-09-23 08:35 EdSchouten Status New => Under Review 2015-09-23 08:35 EdSchouten Assigned To => ajosey 2015-09-23 08:35 EdSchouten Name => Ed Schouten 2015-09-23 08:35 EdSchouten Organization => Nuxi 2015-09-23 08:35 EdSchouten Section => 2015-09-23 08:35 EdSchouten Page Number => n/a 2015-09-23 08:35 EdSchouten Line Number => n/a 2015-09-23 08:46 EdSchouten Section => and 2015-09-23 14:00 eblake Note Added: 0002843 2015-09-23 16:19 EdSchouten Note Added: 0002844 2015-10-01 05:01 shware_systems Note Added: 0002851 2015-10-09 14:00 joerg Note Added: 0002869 2015-11-09 20:57 steffenNote Added: 0002892 2015-11-10 11:33 joerg Note Added: 0002894 2015-11-10 11:58 EdSchouten Note Added: 0002895 2015-11-10 13:08 steffenNote Added: 0002896 2015-11-10 16:20 EdSchouten Note Added: 0002897 2015-11-10 17:07 steffenNote Added: 0002900 2015-11-10 17:27 steffenNote Added: 0002901 2016-07-07 23:18 shware_systems Note Added: 0003293 2016-09-14 14:25 emaste Issue Monitored: emaste 2020-09-03 10:45 geoffclare Note Added: 0004967 2020-09-03 10:47 geoffclare Note Edited: 0004967 2020-09-03 10:49 geoffclare Note Edited: 0004967 2020-09-03 13:52 geoffclare Note Edited: 0004967 2020-09-03 13:59 geoffclare Note Edited: 0004967 2020-10-16 09:29 geoffclare Note Added: 0005050 2021-04-29 15:17 geoffclare Note Added: 0005334 2021-04-29 15:18 geoffclare Interp Status => --- 2021-04-29 15:18 geoffclare Final Accepted Text => https://austingroupbugs.net/view.php?id=986#c5334 2021-04-29 15:18 geoffclare Status Under Review => Resolved 2021-04-29 15:18 geoffclare Resolution Open => Accepted As Marked 2021-04-29 15:18 geoffclare Tag Attached: issue8 2021-05-07 15:18 geoffclare Status Resolved => Applied 2022-06-29 16:05 Florian Weimer Issue Monitored: Florian Weimer 2022-06-30 08:39 geoffclare Relationship added related to 0001591 ==
[1003.1(2008)/Issue 7 0000986]: Would it be worth investigating adding strlcpy(), strlcat(), wcslcpy() and wcslcat()?
The following issue has a resolution that has been APPLIED. == https://austingroupbugs.net/view.php?id=986 == Reported By:EdSchouten Assigned To:ajosey == Project:1003.1(2008)/Issue 7 Issue ID: 986 Category: Base Definitions and Headers Type: Clarification Requested Severity: Editorial Priority: normal Status: Applied Name: Ed Schouten Organization: Nuxi User Reference: Section: and Page Number:n/a Line Number:n/a Interp Status: --- Final Accepted Text:https://austingroupbugs.net/view.php?id=986#c5334 Resolution: Accepted As Marked Fixed in Version: == Date Submitted: 2015-09-23 08:35 UTC Last Modified: 2021-05-07 15:18 UTC == Summary:Would it be worth investigating adding strlcpy(), strlcat(), wcslcpy() and wcslcat()? == Issue History Date ModifiedUsername FieldChange == 2015-09-23 08:35 EdSchouten New Issue 2015-09-23 08:35 EdSchouten Status New => Under Review 2015-09-23 08:35 EdSchouten Assigned To => ajosey 2015-09-23 08:35 EdSchouten Name => Ed Schouten 2015-09-23 08:35 EdSchouten Organization => Nuxi 2015-09-23 08:35 EdSchouten Section => 2015-09-23 08:35 EdSchouten Page Number => n/a 2015-09-23 08:35 EdSchouten Line Number => n/a 2015-09-23 08:46 EdSchouten Section => and 2015-09-23 14:00 eblake Note Added: 0002843 2015-09-23 16:19 EdSchouten Note Added: 0002844 2015-10-01 05:01 shware_systems Note Added: 0002851 2015-10-09 14:00 joerg Note Added: 0002869 2015-11-09 20:57 steffenNote Added: 0002892 2015-11-10 11:33 joerg Note Added: 0002894 2015-11-10 11:58 EdSchouten Note Added: 0002895 2015-11-10 13:08 steffenNote Added: 0002896 2015-11-10 16:20 EdSchouten Note Added: 0002897 2015-11-10 17:07 steffenNote Added: 0002900 2015-11-10 17:27 steffenNote Added: 0002901 2016-07-07 23:18 shware_systems Note Added: 0003293 2016-09-14 14:25 emaste Issue Monitored: emaste 2020-09-03 10:45 geoffclare Note Added: 0004967 2020-09-03 10:47 geoffclare Note Edited: 0004967 2020-09-03 10:49 geoffclare Note Edited: 0004967 2020-09-03 13:52 geoffclare Note Edited: 0004967 2020-09-03 13:59 geoffclare Note Edited: 0004967 2020-10-16 09:29 geoffclare Note Added: 0005050 2021-04-29 15:17 geoffclare Note Added: 0005334 2021-04-29 15:18 geoffclare Interp Status => --- 2021-04-29 15:18 geoffclare Final Accepted Text => https://austingroupbugs.net/view.php?id=986#c5334 2021-04-29 15:18 geoffclare Status Under Review => Resolved 2021-04-29 15:18 geoffclare Resolution Open => Accepted As Marked 2021-04-29 15:18 geoffclare Tag Attached: issue8 2021-05-07 15:18 geoffclare Status Resolved => Applied ==
[1003.1(2008)/Issue 7 0000986]: Would it be worth investigating adding strlcpy(), strlcat(), wcslcpy() and wcslcat()?
The following issue has been RESOLVED. == https://austingroupbugs.net/view.php?id=986 == Reported By:EdSchouten Assigned To:ajosey == Project:1003.1(2008)/Issue 7 Issue ID: 986 Category: Base Definitions and Headers Type: Clarification Requested Severity: Editorial Priority: normal Status: Resolved Name: Ed Schouten Organization: Nuxi User Reference: Section: and Page Number:n/a Line Number:n/a Interp Status: --- Final Accepted Text:https://austingroupbugs.net/view.php?id=986#c5334 Resolution: Accepted As Marked Fixed in Version: == Date Submitted: 2015-09-23 08:35 UTC Last Modified: 2021-04-29 15:18 UTC == Summary:Would it be worth investigating adding strlcpy(), strlcat(), wcslcpy() and wcslcat()? == Issue History Date ModifiedUsername FieldChange == 2015-09-23 08:35 EdSchouten New Issue 2015-09-23 08:35 EdSchouten Status New => Under Review 2015-09-23 08:35 EdSchouten Assigned To => ajosey 2015-09-23 08:35 EdSchouten Name => Ed Schouten 2015-09-23 08:35 EdSchouten Organization => Nuxi 2015-09-23 08:35 EdSchouten Section => 2015-09-23 08:35 EdSchouten Page Number => n/a 2015-09-23 08:35 EdSchouten Line Number => n/a 2015-09-23 08:46 EdSchouten Section => and 2015-09-23 14:00 eblake Note Added: 0002843 2015-09-23 16:19 EdSchouten Note Added: 0002844 2015-10-01 05:01 shware_systems Note Added: 0002851 2015-10-09 14:00 joerg Note Added: 0002869 2015-11-09 20:57 steffenNote Added: 0002892 2015-11-10 11:33 joerg Note Added: 0002894 2015-11-10 11:58 EdSchouten Note Added: 0002895 2015-11-10 13:08 steffenNote Added: 0002896 2015-11-10 16:20 EdSchouten Note Added: 0002897 2015-11-10 17:07 steffenNote Added: 0002900 2015-11-10 17:27 steffenNote Added: 0002901 2016-07-07 23:18 shware_systems Note Added: 0003293 2016-09-14 14:25 emaste Issue Monitored: emaste 2020-09-03 10:45 geoffclare Note Added: 0004967 2020-09-03 10:47 geoffclare Note Edited: 0004967 2020-09-03 10:49 geoffclare Note Edited: 0004967 2020-09-03 13:52 geoffclare Note Edited: 0004967 2020-09-03 13:59 geoffclare Note Edited: 0004967 2020-10-16 09:29 geoffclare Note Added: 0005050 2021-04-29 15:17 geoffclare Note Added: 0005334 2021-04-29 15:18 geoffclare Interp Status => --- 2021-04-29 15:18 geoffclare Final Accepted Text => https://austingroupbugs.net/view.php?id=986#c5334 2021-04-29 15:18 geoffclare Status Under Review => Resolved 2021-04-29 15:18 geoffclare Resolution Open => Accepted As Marked ==
[1003.1(2008)/Issue 7 0000986]: Would it be worth investigating adding strlcpy(), strlcat(), wcslcpy() and wcslcat()?
A NOTE has been added to this issue. == https://austingroupbugs.net/view.php?id=986 == Reported By:EdSchouten Assigned To:ajosey == Project:1003.1(2008)/Issue 7 Issue ID: 986 Category: Base Definitions and Headers Type: Clarification Requested Severity: Editorial Priority: normal Status: Under Review Name: Ed Schouten Organization: Nuxi User Reference: Section: and Page Number:n/a Line Number:n/a Interp Status: --- Final Accepted Text: == Date Submitted: 2015-09-23 08:35 UTC Last Modified: 2021-04-29 15:17 UTC == Summary:Would it be worth investigating adding strlcpy(), strlcat(), wcslcpy() and wcslcat()? == -- (0005334) geoffclare (manager) - 2021-04-29 15:17 https://austingroupbugs.net/view.php?id=986#c5334 -- Make the changes from "Additional APIs for Issue 8, Part 1" (Austin/1110). Issue History Date ModifiedUsername FieldChange == 2015-09-23 08:35 EdSchouten New Issue 2015-09-23 08:35 EdSchouten Status New => Under Review 2015-09-23 08:35 EdSchouten Assigned To => ajosey 2015-09-23 08:35 EdSchouten Name => Ed Schouten 2015-09-23 08:35 EdSchouten Organization => Nuxi 2015-09-23 08:35 EdSchouten Section => 2015-09-23 08:35 EdSchouten Page Number => n/a 2015-09-23 08:35 EdSchouten Line Number => n/a 2015-09-23 08:46 EdSchouten Section => and 2015-09-23 14:00 eblake Note Added: 0002843 2015-09-23 16:19 EdSchouten Note Added: 0002844 2015-10-01 05:01 shware_systems Note Added: 0002851 2015-10-09 14:00 joerg Note Added: 0002869 2015-11-09 20:57 steffenNote Added: 0002892 2015-11-10 11:33 joerg Note Added: 0002894 2015-11-10 11:58 EdSchouten Note Added: 0002895 2015-11-10 13:08 steffenNote Added: 0002896 2015-11-10 16:20 EdSchouten Note Added: 0002897 2015-11-10 17:07 steffenNote Added: 0002900 2015-11-10 17:27 steffenNote Added: 0002901 2016-07-07 23:18 shware_systems Note Added: 0003293 2016-09-14 14:25 emaste Issue Monitored: emaste 2020-09-03 10:45 geoffclare Note Added: 0004967 2020-09-03 10:47 geoffclare Note Edited: 0004967 2020-09-03 10:49 geoffclare Note Edited: 0004967 2020-09-03 13:52 geoffclare Note Edited: 0004967 2020-09-03 13:59 geoffclare Note Edited: 0004967 2020-10-16 09:29 geoffclare Note Added: 0005050 2021-04-29 15:17 geoffclare Note Added: 0005334 ==
[1003.1(2008)/Issue 7 0000986]: Would it be worth investigating adding strlcpy(), strlcat(), wcslcpy() and wcslcat()?
A NOTE has been added to this issue. == https://austingroupbugs.net/view.php?id=986 == Reported By:EdSchouten Assigned To:ajosey == Project:1003.1(2008)/Issue 7 Issue ID: 986 Category: Base Definitions and Headers Type: Clarification Requested Severity: Editorial Priority: normal Status: Under Review Name: Ed Schouten Organization: Nuxi User Reference: Section: and Page Number:n/a Line Number:n/a Interp Status: --- Final Accepted Text: == Date Submitted: 2015-09-23 08:35 UTC Last Modified: 2020-10-16 09:29 UTC == Summary:Would it be worth investigating adding strlcpy(), strlcat(), wcslcpy() and wcslcat()? == -- (0005050) geoffclare (manager) - 2020-10-16 09:29 https://austingroupbugs.net/view.php?id=986#c5050 -- The additions for these four functions have been made in the Issue8NewAPIs branch in gitlab, based on https://austingroupbugs.net/view.php?id=986#c4967. Issue History Date ModifiedUsername FieldChange == 2015-09-23 08:35 EdSchouten New Issue 2015-09-23 08:35 EdSchouten Status New => Under Review 2015-09-23 08:35 EdSchouten Assigned To => ajosey 2015-09-23 08:35 EdSchouten Name => Ed Schouten 2015-09-23 08:35 EdSchouten Organization => Nuxi 2015-09-23 08:35 EdSchouten Section => 2015-09-23 08:35 EdSchouten Page Number => n/a 2015-09-23 08:35 EdSchouten Line Number => n/a 2015-09-23 08:46 EdSchouten Section => and 2015-09-23 14:00 eblake Note Added: 0002843 2015-09-23 16:19 EdSchouten Note Added: 0002844 2015-10-01 05:01 shware_systems Note Added: 0002851 2015-10-09 14:00 joerg Note Added: 0002869 2015-11-09 20:57 steffenNote Added: 0002892 2015-11-10 11:33 joerg Note Added: 0002894 2015-11-10 11:58 EdSchouten Note Added: 0002895 2015-11-10 13:08 steffenNote Added: 0002896 2015-11-10 16:20 EdSchouten Note Added: 0002897 2015-11-10 17:07 steffenNote Added: 0002900 2015-11-10 17:27 steffenNote Added: 0002901 2016-07-07 23:18 shware_systems Note Added: 0003293 2016-09-14 14:25 emaste Issue Monitored: emaste 2020-09-03 10:45 geoffclare Note Added: 0004967 2020-09-03 10:47 geoffclare Note Edited: 0004967 2020-09-03 10:49 geoffclare Note Edited: 0004967 2020-09-03 13:52 geoffclare Note Edited: 0004967 2020-09-03 13:59 geoffclare Note Edited: 0004967 2020-10-16 09:29 geoffclare Note Added: 0005050 ==
[1003.1(2008)/Issue 7 0000986]: Would it be worth investigating adding strlcpy(), strlcat(), wcslcpy() and wcslcat()?
A NOTE has been added to this issue. == https://austingroupbugs.net/view.php?id=986 == Reported By:EdSchouten Assigned To:ajosey == Project:1003.1(2008)/Issue 7 Issue ID: 986 Category: Base Definitions and Headers Type: Clarification Requested Severity: Editorial Priority: normal Status: Under Review Name: Ed Schouten Organization: Nuxi User Reference: Section: and Page Number:n/a Line Number:n/a Interp Status: --- Final Accepted Text: == Date Submitted: 2015-09-23 08:35 UTC Last Modified: 2020-09-03 10:45 UTC == Summary:Would it be worth investigating adding strlcpy(), strlcat(), wcslcpy() and wcslcat()? == -- (0004967) geoffclare (manager) - 2020-09-03 10:45 https://austingroupbugs.net/view.php?id=986#c4967 -- Suggested changes to go into The Open Group company review... Page and line numbers are for the 2016/2018 edition. On page 363 line 12410 section , add:[CX]size_t strlcat(char *restrict, const char *restrict, size_t); size_t strlcpy(char *restrict, const char *restrict, size_t);[/CX] On page 460 line 15893 section , add:[CX]size_t wcslcat(wchar_t *restrict, const wchar_t *restrict, size_t); size_t wcslcpy(wchar_t *restrict, const wchar_t *restrict, size_t);[/CX] On page 494 line 17097-17146 section 2.4.3, add strlcat(), strlcpy(), wcslcat(), and wcslcpy() to the table of async-signal-safe functions. On page 2053 insert a new strlcat page: NAMEstrlcat, strlcpy -- size-bounded string concatenation and copying SYNOPSIS#include [CX]size_t strlcat(char *restrict dst, const char *restrict src, size_t dstsize); size_t strlcpy(char *restrict dst, const char *restrict src, size_t dstsize);[/CX] DESCRIPTIONThe strlcpy() and strlcat() functions copy and concatenate strings, stopping when either a NUL terminator in the source string is encountered or the specified full size of the destination buffer is reached. They NUL terminate the result if there is room. The application should ensure that room for the NUL terminator is included in dstsize. The strlcpy() function shall copy not more than dstsize - 1 bytes from the string pointed to by src to the array pointed to by dst; a NUL byte in src and bytes that follow it shall not be copied. A terminating NUL byte shall be appended to the result, unless dstsize is 0. If copying takes place between objects that overlap, the behavior is undefined. The strlcat() function shall append not more than dstsize - strlen(dst) - 1 bytes from the string pointed to by src to the end of the string pointed to by dst; a NUL byte in src and bytes that follow it shall not be appended. The initial byte of src shall overwrite the NUL byte at the end of dst. A terminating NUL byte shall be appended to the result, unless its location would be at or beyond dst + dstsize. If copying takes place between objects that overlap, the behavior is undefined. The strlcpy() and strlcat() functions shall not change the setting of errno on valid input. RETURN VALUEUpon successful completion, the strlcpy() function shall return the length of the string pointed to by src; that is, the number of bytes in the string, not including the terminating NUL byte. Upon successful completion, the strlcat() function shall return the initial length of the string pointed to by dst plus the length of the string pointed to by src. No return values are reserved to indicate an error. ERRORSNo errors are defined. EXAMPLESThe following example detects truncation while combining a path prefix (including trailing ) and a filename to produce a portable pathname:char *prefix, *filenam, pathnam[_POSIX_PATH_MAX]; if (strlcpy(pathnam, prefix, sizeof pathnam) >= sizeof pathnam || strlcat(pathnam, filenam, sizeof pathnam) >= sizeof pathnam) { // truncation occurred ... } This code ensures there is room for the NUL terminator by:Calling strlcpy() with a non-zero dstsize argument. Only calling strlcat() if the return value of strlcpy() indicated that truncation did not occur. APPLICATION USAGEThe return value of the strlcpy() and strlcat() functions follows the same convention as snprintf(); that is, they return