[CRIU] [PATCH 1/2] crtools: fix a bug that log_level may not work

Huang Qiang h.huangqiang at huawei.com
Thu Nov 1 22:01:54 EDT 2012


If we use -v [num] to set log_level and we happen to set it in the end of
arguments, the [num] we set may not work. This patch will fix it.

Signed-off-by: Huang Qiang <h.huangqiang at huawei.com>
---
 crtools.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/crtools.c b/crtools.c
index 21be6bc..c2c0c9b 100644
--- a/crtools.c
+++ b/crtools.c
@@ -147,7 +147,7 @@ int main(int argc, char *argv[])
 				return -1;
 			break;
 		case 'v':
-			if (optind < argc - 1) {
+			if (optind < argc) {
 				char *opt = argv[optind];
 
 				if (isdigit(*opt)) {
-- 
1.7.1




More information about the CRIU mailing list