On Wed, Apr 05, 2023 at 08:25:21AM -0700, Tyler Retzlaff wrote:
> On Wed, Apr 05, 2023 at 09:54:46AM +0100, Bruce Richardson wrote:
> > On Tue, Apr 04, 2023 at 06:04:32PM -0700, Stephen Hemminger wrote:
> > > On Tue, 4 Apr 2023 09:47:21 +0100
> > > Bruce Richardson wrote:
> > >
> > > > My suggest
On Wed, 5 Apr 2023 18:30:51 +0300
Dmitry Kozlyuk wrote:
> 2023-04-05 08:25 (UTC-0700), Tyler Retzlaff:
> > On Wed, Apr 05, 2023 at 09:54:46AM +0100, Bruce Richardson wrote:
> > > On Tue, Apr 04, 2023 at 06:04:32PM -0700, Stephen Hemminger wrote:
> > > > On Tue, 4 Apr 2023 09:47:21 +0100
> >
2023-04-05 08:25 (UTC-0700), Tyler Retzlaff:
> On Wed, Apr 05, 2023 at 09:54:46AM +0100, Bruce Richardson wrote:
> > On Tue, Apr 04, 2023 at 06:04:32PM -0700, Stephen Hemminger wrote:
> > > On Tue, 4 Apr 2023 09:47:21 +0100
> > > Bruce Richardson wrote:
> > >
> > > > My suggestion is to use a
On Wed, Apr 05, 2023 at 09:54:46AM +0100, Bruce Richardson wrote:
> On Tue, Apr 04, 2023 at 06:04:32PM -0700, Stephen Hemminger wrote:
> > On Tue, 4 Apr 2023 09:47:21 +0100
> > Bruce Richardson wrote:
> >
> > > My suggestion is to use a combination of these methods. In json_snprintf
> > > check i
On Tue, Apr 04, 2023 at 06:04:32PM -0700, Stephen Hemminger wrote:
> On Tue, 4 Apr 2023 09:47:21 +0100
> Bruce Richardson wrote:
>
> > My suggestion is to use a combination of these methods. In json_snprintf
> > check if the input buffer is empty or has only one character in it, and use
> > metho
On Tue, Apr 04, 2023 at 06:20:04PM -0700, Stephen Hemminger wrote:
> On Tue, 4 Apr 2023 10:34:01 -0700
> Tyler Retzlaff wrote:
>
> > > > > I think suggestion #2 above should cover most cases, in which case
> > > > > using
> > > > > your original suggestion of malloc would be ok too for the rare
On Tue, 4 Apr 2023 10:34:01 -0700
Tyler Retzlaff wrote:
> > > > I think suggestion #2 above should cover most cases, in which case using
> > > > your original suggestion of malloc would be ok too for the rare case (if
> > > > ever) where we don't just have one terminator on the end.
> > >
> >
On Tue, 4 Apr 2023 09:47:21 +0100
Bruce Richardson wrote:
> My suggestion is to use a combination of these methods. In json_snprintf
> check if the input buffer is empty or has only one character in it, and use
> method #2 if so. If that's not the case, then fallback to method #1 and do
> a doubl
On Tue, Apr 04, 2023 at 06:25:42PM +0100, Bruce Richardson wrote:
> On Tue, Apr 04, 2023 at 09:44:46AM -0700, Tyler Retzlaff wrote:
> > On Tue, Apr 04, 2023 at 05:28:29PM +0100, Bruce Richardson wrote:
> > > On Tue, Apr 04, 2023 at 09:24:44AM -0700, Tyler Retzlaff wrote:
> > > > On Tue, Apr 04, 202
On Tue, Apr 04, 2023 at 09:44:46AM -0700, Tyler Retzlaff wrote:
> On Tue, Apr 04, 2023 at 05:28:29PM +0100, Bruce Richardson wrote:
> > On Tue, Apr 04, 2023 at 09:24:44AM -0700, Tyler Retzlaff wrote:
> > > On Tue, Apr 04, 2023 at 09:47:21AM +0100, Bruce Richardson wrote:
> > > > On Mon, Apr 03, 202
On Tue, Apr 04, 2023 at 05:28:29PM +0100, Bruce Richardson wrote:
> On Tue, Apr 04, 2023 at 09:24:44AM -0700, Tyler Retzlaff wrote:
> > On Tue, Apr 04, 2023 at 09:47:21AM +0100, Bruce Richardson wrote:
> > > On Mon, Apr 03, 2023 at 01:19:12PM -0700, Stephen Hemminger wrote:
> > > > On Mon, 3 Apr 2
On Tue, Apr 04, 2023 at 09:24:44AM -0700, Tyler Retzlaff wrote:
> On Tue, Apr 04, 2023 at 09:47:21AM +0100, Bruce Richardson wrote:
> > On Mon, Apr 03, 2023 at 01:19:12PM -0700, Stephen Hemminger wrote:
> > > On Mon, 3 Apr 2023 09:30:23 -0700
> > > Tyler Retzlaff wrote:
> > >
> > > > __json_snp
On Tue, Apr 04, 2023 at 09:47:21AM +0100, Bruce Richardson wrote:
> On Mon, Apr 03, 2023 at 01:19:12PM -0700, Stephen Hemminger wrote:
> > On Mon, 3 Apr 2023 09:30:23 -0700
> > Tyler Retzlaff wrote:
> >
> > > __json_snprintf(char *buf, const int len, const char *format, ...)
> > > {
> > > - ch
On Mon, Apr 03, 2023 at 01:19:12PM -0700, Stephen Hemminger wrote:
> On Mon, 3 Apr 2023 09:30:23 -0700
> Tyler Retzlaff wrote:
>
> > __json_snprintf(char *buf, const int len, const char *format, ...)
> > {
> > - char tmp[len];
> > + char *tmp = malloc(len);
> > va_list ap;
> > - int
On Mon, Apr 03, 2023 at 01:19:12PM -0700, Stephen Hemminger wrote:
> On Mon, 3 Apr 2023 09:30:23 -0700
> Tyler Retzlaff wrote:
>
> > __json_snprintf(char *buf, const int len, const char *format, ...)
> > {
> > - char tmp[len];
> > + char *tmp = malloc(len);
> > va_list ap;
> > - int
On Mon, 3 Apr 2023 09:30:23 -0700
Tyler Retzlaff wrote:
> __json_snprintf(char *buf, const int len, const char *format, ...)
> {
> - char tmp[len];
> + char *tmp = malloc(len);
> va_list ap;
> - int ret;
> + int ret = 0;
> +
> + if (tmp == NULL)
> + return
On Mon, Apr 03, 2023 at 09:30:23AM -0700, Tyler Retzlaff wrote:
> Replace use of variable length array optional standard feature to
> improve portability.
>
> Signed-off-by: Tyler Retzlaff
> ---
> lib/telemetry/telemetry_json.h | 32 +++-
> 1 file changed, 23 insertio
Replace use of variable length array optional standard feature to
improve portability.
Signed-off-by: Tyler Retzlaff
---
lib/telemetry/telemetry_json.h | 32 +++-
1 file changed, 23 insertions(+), 9 deletions(-)
diff --git a/lib/telemetry/telemetry_json.h b/lib/telem
18 matches
Mail list logo