diff options
author | Hans Bolinder <[email protected]> | 2017-06-29 16:38:12 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2017-09-15 17:07:48 +0200 |
commit | a443d41a1b7951137021e35ce480fbdd896f5cbc (patch) | |
tree | 43c78ff5e587fbd1650815e24af31ca50dc72706 /lib/compiler/src/core_scan.erl | |
parent | 15abdca7ef9c6fb7812f13829346db59173e5681 (diff) | |
download | otp-a443d41a1b7951137021e35ce480fbdd896f5cbc.tar.gz otp-a443d41a1b7951137021e35ce480fbdd896f5cbc.tar.bz2 otp-a443d41a1b7951137021e35ce480fbdd896f5cbc.zip |
compiler: Do not use deprecated functions in string(3)
Diffstat (limited to 'lib/compiler/src/core_scan.erl')
-rw-r--r-- | lib/compiler/src/core_scan.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/compiler/src/core_scan.erl b/lib/compiler/src/core_scan.erl index 9f0676538f..a50a2ffa8d 100644 --- a/lib/compiler/src/core_scan.erl +++ b/lib/compiler/src/core_scan.erl @@ -200,8 +200,8 @@ pre_string(eof, Q, _, Sp, SoFar, Pos) -> pre_string_error(Q, Sp, SoFar, Pos). pre_string_error(Q, Sp, SoFar, Pos) -> - S = reverse(string:substr(SoFar, 1, string:chr(SoFar, Q)-1)), - pre_error({string,Q,string:substr(S, 1, 16)}, Sp, Pos). + [S,_] = string:split(SoFar, [Q]), + pre_error({string,Q,string:slice(string:reverse(S), 0, 16)}, Sp, Pos). pre_char([C|Cs], SoFar) -> pre_char(C, Cs, SoFar); pre_char([], _) -> more; |