From d41a3e1fdb33eda0977e0fc64faa2caddf07e443 Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Wed, 9 Aug 2017 01:49:56 -0700 Subject: Fix off-by-one error when detecting physical machine type --- modules/computer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/computer.c') diff --git a/modules/computer.c b/modules/computer.c index d0379b79..dd4961ec 100644 --- a/modules/computer.c +++ b/modules/computer.c @@ -326,7 +326,7 @@ static gchar *detect_machine_type(void) }; int chassis_type = atoi(idle_free(chassis)); - if (chassis_type >= 0 && chassis_type <= G_N_ELEMENTS(types)) + if (chassis_type >= 0 && chassis_type < G_N_ELEMENTS(types)) return g_strdup(_(types[chassis_type])); } -- cgit v1.2.3