Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libcdi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mpim-sw
libcdi
Commits
e6630d8d
Commit
e6630d8d
authored
Jul 07, 2020
by
Uwe Schulzweida
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cdiInqKeyString: set string[maxlength-1] = '\0'
parent
c1095b0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
src/cdi_key.c
src/cdi_key.c
+3
-1
No files found.
src/cdi_key.c
View file @
e6630d8d
...
...
@@ -662,10 +662,12 @@ int cdiInqKeyString(int cdiID, int varID, int key, char *string, int *length)
xassert
(
string
!=
NULL
);
xassert
(
length
!=
NULL
);
string
[
0
]
=
'\0'
;
int
maxlength
=
*
length
;
if
(
maxlength
>
0
)
string
[
0
]
=
'\0'
;
int
status
=
cdiInqKeyBytes
(
cdiID
,
varID
,
key
,
(
unsigned
char
*
)
string
,
length
);
if
(
status
!=
CDI_NOERR
)
*
length
=
0
;
else
string
[
maxlength
-
1
]
=
'\0'
;
return
status
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment