summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
Diffstat (limited to 'package')
-rw-r--r--package/config/confdata.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/package/config/confdata.c b/package/config/confdata.c
index 51a3d9a6f..728f708ca 100644
--- a/package/config/confdata.c
+++ b/package/config/confdata.c
@@ -864,7 +864,8 @@ void conf_set_all_new_symbols(enum conf_def_mode mode)
sym->def[S_DEF_USER].tri = no;
break;
case def_random:
- sym->def[S_DEF_USER].tri = (tristate)(rand() % 3);
+ cnt = sym_get_type(sym) == S_TRISTATE ? 3 : 2;
+ sym->def[S_DEF_USER].tri = (tristate)(rand() % cnt);
break;
default:
continue;