All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lscpu: fix backward buffer size adjustment after adding delimiter
@ 2016-02-27 15:00 Yuriy M. Kaminskiy
  2016-02-27 16:14 ` [PATCH 2/3] lib/sysfs.c sys-utils/lsns.c: fix error return Yuriy M. Kaminskiy
  2016-03-07 14:16 ` [PATCH] lscpu: fix backward buffer size adjustment after adding delimiter Karel Zak
  0 siblings, 2 replies; 5+ messages in thread
From: Yuriy M. Kaminskiy @ 2016-02-27 15:00 UTC (permalink / raw)
  To: util-linux

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/x-diff, Size: 937 bytes --]

>From dfa883887123b5dd0f4230ae4aadd178bb49f4e5 Mon Sep 17 00:00:00 2001
From: "Yuriy M. Kaminskiy" <yumkam@gmail.com>
Date: Sat, 27 Feb 2016 17:55:07 +0300
Subject: [PATCH] lscpu: fix backward size buffer adjustment after adding
 delimiter

remaining buffer space was increased after adding character, instead of
decreasing
---
 sys-utils/lscpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index b169d7a..ecff1a7 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -1281,7 +1281,7 @@ get_cell_data(struct lscpu_desc *desc, int idx, int col,
 			if (j != 0) {
 				*p++ = mod->compat ? ',' : ':';
 				*p = '\0';
-				sz++;
+				sz--;
 			}
 		}
 		break;
@@ -1353,7 +1353,7 @@ get_cell_header(struct lscpu_desc *desc, int col,
 			if (i > 0) {
 				*p++ = mod->compat ? ',' : ':';
 				*p = '\0';
-				sz++;
+				sz--;
 			}
 		}
 		if (desc->ncaches)
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-03-07 14:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-27 15:00 [PATCH] lscpu: fix backward buffer size adjustment after adding delimiter Yuriy M. Kaminskiy
2016-02-27 16:14 ` [PATCH 2/3] lib/sysfs.c sys-utils/lsns.c: fix error return Yuriy M. Kaminskiy
2016-02-27 16:27   ` [PATCH 3/3] snprintf: safer (and uniform) handling of return value Yuriy M. Kaminskiy
2016-03-07 12:43     ` Karel Zak
2016-03-07 14:16 ` [PATCH] lscpu: fix backward buffer size adjustment after adding delimiter Karel Zak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.