Skip to content

Commit

Permalink
Use strlen instead of pointer length
Browse files Browse the repository at this point in the history
Since we no longer use stack allocated char[] it's important which one we use
  • Loading branch information
Jalle19 committed Aug 7, 2024
1 parent bd74be8 commit 1905e29
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api/variables.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ int get_json_state(char *buf, int len, char *sbuf, int slen) {
funs(off, sbuf, slen - 1);
if (off > 0)
strlcatf(buf, len, ptr, ",");
ptr += escape_json_string(buf + ptr, len - ptr, sbuf, slen);
ptr += escape_json_string(buf + ptr, len - ptr, sbuf,
strlen(sbuf));
}
strlcatf(buf, len, ptr, "]");
// LOG("func_str -> %s", buf);
Expand Down

0 comments on commit 1905e29

Please sign in to comment.