diff --git a/blobmsg_json.c b/blobmsg_json.c index dce81e9..ec8b482 100644 --- a/blobmsg_json.c +++ b/blobmsg_json.c @@ -151,15 +151,15 @@ static bool blobmsg_puts(struct strbuf *s, const char *c, int len) static void add_separator(struct strbuf *s) { - const char *indent_chars = "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"; + const char indent_chars[] = "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"; size_t len; if (!s->indent) return; len = s->indent_level + 1; - if (len > strlen(indent_chars)) - len = strlen(indent_chars); + if (len > sizeof(indent_chars) - 1) + len = sizeof(indent_chars) - 1; blobmsg_puts(s, indent_chars, len); }