[PATCH] osmocon: correct parsing of -m

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/baseband-devel@lists.osmocom.org/.

Alexander Huemer alexander.huemer at xx.vu
Tue Dec 13 21:35:04 UTC 2011


---
 src/host/osmocon/osmocon.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/host/osmocon/osmocon.c b/src/host/osmocon/osmocon.c
index 5f28992..fc29506 100644
--- a/src/host/osmocon/osmocon.c
+++ b/src/host/osmocon/osmocon.c
@@ -123,6 +123,7 @@ enum dnload_mode {
 	MODE_C155,
 	MODE_ROMLOAD,
 	MODE_MTK,
+	MODE_INVALID,
 };
 
 struct dnload {
@@ -1184,7 +1185,7 @@ static int parse_mode(const char *arg)
 	else if (!strcasecmp(arg, "mtk"))
 		return MODE_MTK;
 
-	return -1;
+	return MODE_INVALID;
 }
 
 #define HELP_TEXT \
@@ -1413,7 +1414,7 @@ int main(int argc, char **argv)
 			break;
 		case 'm':
 			dnload.mode = parse_mode(optarg);
-			if (dnload.mode < 0)
+			if (dnload.mode == MODE_INVALID)
 				usage(argv[0]);
 			break;
 		case 's':
-- 
1.7.8





More information about the baseband-devel mailing list