[PATCH v2 1/9] pulse: Add a JSON-parsing library

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2016-06-01 at 17:18 +0530, Arun Raghavan wrote:
> +static const char* parse_string(const char *str, pa_json_object *obj) {
> +    pa_strbuf *buf = pa_strbuf_new();
> +
> +    str++; /* Consume leading '"' */
> +
> +    while (*str != '"') {
> +        if (*str != '\\') {
> +            /* We don't accept non-ASCII, non-control characters */

This comment seems to be saying either that we don't accept any
printable characters, or that we don't accept non-ASCII printable
characters. Rewording suggestion: "We only accept ASCII printable
characters."

> +            if (*str < 0x20) {

Should be "if (*str < 0x20 || *str > 0x7E) {"

-- 
Tanu


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux