Re: [PATCH] tools: bpftool: json: fix backslash escape typo in jsonw_puts

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

 



2023-03-29 00:30 UTC-0700 ~ Manu Bretelle <chantr4@xxxxxxxxx>
> This is essentially a backport of iproute2's
> commit ed54f76484b5 ("json: fix backslash escape typo in jsonw_puts")
> 
> Also added the stdio.h include in json_writer.h to be able to compile
> and run the json_writer test as used below).
> 
> Before this fix:
> 
> $ gcc -D notused -D TEST -I../../include -o json_writer  json_writer.c
> json_writer.h
> $ ./json_writer
> {
>     "Vyatta": {
>         "url": "http://vyatta.com";,
>         "downloads": 2000000,
>         "stock": 8.16,
>         "ARGV": [],
>         "empty": [],
>         "NIL": {},
>         "my_null": null,
>         "special chars": [
>             "slash": "/",
>             "newline": "\n",
>             "tab": "\t",
>             "ff": "\f",
>             "quote": "\"",
>             "tick": "'",
>             "backslash": "\n"
>         ]
>     }
> }
> 
> After:
> 
> $ gcc -D notused -D TEST -I../../include -o json_writer  json_writer.c
> json_writer.h
> $ ./json_writer
> {
>     "Vyatta": {
>         "url": "http://vyatta.com";,
>         "downloads": 2000000,
>         "stock": 8.16,
>         "ARGV": [],
>         "empty": [],
>         "NIL": {},
>         "my_null": null,
>         "special chars": [
>             "slash": "/",
>             "newline": "\n",
>             "tab": "\t",
>             "ff": "\f",
>             "quote": "\"",
>             "tick": "'",
>             "backslash": "\\"
>         ]
>     }
> }
> 
> Signed-off-by: Manu Bretelle <chantr4@xxxxxxxxx>

Reviewed-by: Quentin Monnet <quentin@xxxxxxxxxxxxx>

Thank you!




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux