diff --git a/src/error_handling.jl b/src/error_handling.jl index 8062361b..a55345ee 100644 --- a/src/error_handling.jl +++ b/src/error_handling.jl @@ -60,7 +60,7 @@ Handles a list of thrown errors after no IO library was found working function handle_exceptions(exceptions::Vector, action) # first show all errors when there are more then one multiple = length(exceptions) > 1 - println(STDERR, "Error$(multiple?"s" : "") encountered while $action.") + println(STDERR, "Error$(multiple ? "s" : "") encountered while $action.") if multiple println("All errors:") for (err, file) in exceptions diff --git a/src/registry.jl b/src/registry.jl index b08bb851..af09450d 100644 --- a/src/registry.jl +++ b/src/registry.jl @@ -141,10 +141,10 @@ add_format(format"GSLIB", (), [".gslib",".sgems"], [:GslibIO]) ### Audio formats function detectwav(io) seekstart(io) - magic = read(io, UInt8, 4) + magic = read!(io, Vector{UInt8}(4)) magic == b"RIFF" || return false seek(io, 8) - submagic = read(io, UInt8, 4) + submagic = read!(io, Vector{UInt8}(4)) submagic == b"WAVE" end @@ -157,10 +157,10 @@ add_format(format"FLAC","fLaC",".flac",[:FLAC]) # AVI is a subtype of RIFF, as is WAV function detectavi(io) seekstart(io) - magic = read(io, UInt8, 4) + magic = read!(io, Vector{UInt8}(4)) magic == b"RIFF" || return false seek(io, 8) - submagic = read(io, UInt8, 4) + submagic = read!(io, Vector{UInt8}(4)) submagic == b"AVI " end