diff options
author | Hans Bolinder <[email protected]> | 2017-06-28 13:05:53 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2017-07-06 17:53:22 +0200 |
commit | 792450913beef0b2eec3e3b0a4ebad14563ecadb (patch) | |
tree | 95080fad454bda3ceda26739d775765d62a7aea4 /lib/stdlib/src/erl_lint.erl | |
parent | e2b9eb8735416ded58fbcdfbe11a90b7885f8a31 (diff) | |
download | otp-792450913beef0b2eec3e3b0a4ebad14563ecadb.tar.gz otp-792450913beef0b2eec3e3b0a4ebad14563ecadb.tar.bz2 otp-792450913beef0b2eec3e3b0a4ebad14563ecadb.zip |
stdlib: Do not use deprecated functions in string(3)
Diffstat (limited to 'lib/stdlib/src/erl_lint.erl')
-rw-r--r-- | lib/stdlib/src/erl_lint.erl | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl index 65ba343368..1041783e33 100644 --- a/lib/stdlib/src/erl_lint.erl +++ b/lib/stdlib/src/erl_lint.erl @@ -3910,10 +3910,9 @@ check_format_string(Fmt) -> extract_sequences(Fmt, []). extract_sequences(Fmt, Need0) -> - case string:chr(Fmt, $~) of - 0 -> {ok,lists:reverse(Need0)}; %That's it - Pos -> - Fmt1 = string:substr(Fmt, Pos+1), %Skip ~ + case string:find(Fmt, [$~]) of + nomatch -> {ok,lists:reverse(Need0)}; %That's it + [$~|Fmt1] -> case extract_sequence(1, Fmt1, Need0) of {ok,Need1,Rest} -> extract_sequences(Rest, Need1); Error -> Error |