Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
200bd7a2
Commit
200bd7a2
authored
Mar 04, 2016
by
Thomas Jahns
🤸
Browse files
Fix problems from signed integer size parameter.
parent
8228abb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/grid.c
View file @
200bd7a2
...
...
@@ -637,7 +637,7 @@ The function @func{cdiGridDefString} defines a CDI grid string value from a key.
*/
int
cdiGridDefString
(
int
gridID
,
int
key
,
int
size
,
const
char
*
mesg
)
{
if
(
size
==
0
||
mesg
==
NULL
||
*
mesg
==
0
)
return
-
1
;
if
(
size
<
1
||
mesg
==
NULL
||
*
mesg
==
0
)
return
-
1
;
grid_t
*
gridptr
=
gridID2Ptr
(
gridID
);
...
...
@@ -648,7 +648,7 @@ int cdiGridDefString(int gridID, int key, int size, const char *mesg)
return
-
1
;
}
gridSetString
(
gridstring
,
mesg
,
size
);
gridSetString
(
gridstring
,
mesg
,
(
size_t
)
size
);
gridMark4Update
(
gridID
);
return
0
;
...
...
@@ -678,7 +678,7 @@ The function @func{cdiGridInqString} return a CDI grid string value from a key.
*/
int
cdiGridInqString
(
int
gridID
,
int
key
,
int
size
,
char
*
mesg
)
{
if
(
size
==
0
||
mesg
==
NULL
)
return
-
1
;
if
(
size
<
1
||
mesg
==
NULL
)
return
-
1
;
grid_t
*
gridptr
=
gridID2Ptr
(
gridID
);
const
char
*
gridstring
=
grid_key_to_string
(
gridptr
,
key
);
...
...
@@ -688,7 +688,7 @@ int cdiGridInqString(int gridID, int key, int size, char *mesg)
return
-
1
;
}
gridGetString
(
mesg
,
gridstring
,
size
);
gridGetString
(
mesg
,
gridstring
,
(
size_t
)
size
);
return
0
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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