From d170eb7809501ef16108c27be24ba4ab5797a9c3 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Thu, 26 Oct 2017 14:49:07 +0000
Subject: [PATCH] generate: fix type for option parsing

char may or may not be signed depending on architecture. If char is
unsigned on a given architecture, then will the testing the return value
from getopt_long (which is int) always fail. This happened on some
architectures like ppc64le, aarch64 and s390x.

To fix this we use same type as getopt_long return value: int.

fixes #345

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
 cmd-generate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd-generate.c b/cmd-generate.c
index ce16c25..9eff89a 100644
--- a/cmd-generate.c
+++ b/cmd-generate.c
@@ -61,7 +61,7 @@ int cmd_generate(int argc, char **argv)
 		{"clip", no_argument, NULL, 'c'},
 		{0, 0, 0, 0}
 	};
-	char option;
+	int option;
 	int option_index;
 	char *username = NULL;
 	char *url = NULL;
-- 
2.14.3

