[PATCH] lscpu: fix backward buffer size adjustment after adding delimiter

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

 



>From dfa883887123b5dd0f4230ae4aadd178bb49f4e5 Mon Sep 17 00:00:00 2001
From: "Yuriy M. Kaminskiy" <yumkam@xxxxxxxxx>
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


--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux