Skip to content

Commit 7616145

Browse files
authored
[libc] Fix type signature for strlcpy and strlcat (#104643)
Summary: These should not be const on the destination pointer.
1 parent 362142c commit 7616145

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libc/newhdrgen/yaml/string.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,15 @@ functions:
181181
- BSDExtensions
182182
return_type: size_t
183183
arguments:
184-
- type: const char *__restrict
184+
- type: char *__restrict
185185
- type: const char *__restrict
186186
- type: size_t
187187
- name: strlcpy
188188
standards:
189189
- BSDExtensions
190190
return_type: size_t
191191
arguments:
192-
- type: const char *__restrict
192+
- type: char *__restrict
193193
- type: const char *__restrict
194194
- type: size_t
195195
- name: strlen

libc/spec/bsd_ext.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ def BsdExtensions : StandardSpec<"BSDExtensions"> {
2020
FunctionSpec<
2121
"strlcat",
2222
RetValSpec<SizeTType>,
23-
[ArgSpec<ConstCharRestrictedPtr>, ArgSpec<ConstCharRestrictedPtr>, ArgSpec<SizeTType>]
23+
[ArgSpec<CharRestrictedPtr>, ArgSpec<ConstCharRestrictedPtr>, ArgSpec<SizeTType>]
2424
>,
2525
FunctionSpec<
2626
"strlcpy",
2727
RetValSpec<SizeTType>,
28-
[ArgSpec<ConstCharRestrictedPtr>, ArgSpec<ConstCharRestrictedPtr>, ArgSpec<SizeTType>]
28+
[ArgSpec<CharRestrictedPtr>, ArgSpec<ConstCharRestrictedPtr>, ArgSpec<SizeTType>]
2929
>,
3030
FunctionSpec<
3131
"strsep",

0 commit comments

Comments
 (0)