mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
spa-json: also check for len <= to avoid compiler warning
This commit is contained in:
parent
5987b0e65e
commit
1078df5212
1 changed files with 2 additions and 2 deletions
|
|
@ -384,7 +384,7 @@ static inline int spa_json_parse_float(const char *val, int len, float *result)
|
||||||
char *end;
|
char *end;
|
||||||
int pos;
|
int pos;
|
||||||
|
|
||||||
if (len >= (int)sizeof(buf))
|
if (len <= 0 || len >= (int)sizeof(buf))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (pos = 0; pos < len; ++pos) {
|
for (pos = 0; pos < len; ++pos) {
|
||||||
|
|
@ -434,7 +434,7 @@ static inline int spa_json_parse_int(const char *val, int len, int *result)
|
||||||
char buf[64];
|
char buf[64];
|
||||||
char *end;
|
char *end;
|
||||||
|
|
||||||
if (len >= (int)sizeof(buf))
|
if (len <= 0 || len >= (int)sizeof(buf))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
memcpy(buf, val, len);
|
memcpy(buf, val, len);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue