Update scan.cpp