Skip to content

Commit 708155c

Browse files
committed
Merge branch 'maint'
2 parents 4a731ea + f282d95 commit 708155c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/snmp/src/misc/snmp_config.erl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,7 +1678,7 @@ print_q(Q, Default) when is_list(Default) ->
16781678
%% Defval = string() | mandatory
16791679
ask(Q, Default, Verify) when is_list(Q) andalso is_function(Verify) ->
16801680
print_q(Q, Default),
1681-
PrelAnsw = io:get_line(''),
1681+
PrelAnsw = conv_bin_to_list(io:get_line('')),
16821682
Answer =
16831683
case remove_newline(PrelAnsw) of
16841684
"" when Default =/= mandatory -> Default;
@@ -1741,7 +1741,12 @@ guess_engine_name() ->
17411741
% {_,_} -> "user_id"
17421742
% end.
17431743

1744-
1744+
% This is neccessary as in Elixir io:get_line returns a binary
1745+
conv_bin_to_list(Bin) when is_binary(Bin) ->
1746+
binary:bin_to_list(Bin);
1747+
conv_bin_to_list(Str) ->
1748+
Str.
1749+
17451750
remove_newline(Str) ->
17461751
lists:delete($\n, Str).
17471752

0 commit comments

Comments
 (0)