# HG changeset patch # User Paper # Date 1609788152 18000 # Node ID aac9a23bd0279bc7e422da1e4f1048039a3ddedf # Parent 9241ce1e5abe11cf9c0a6aa03e141f7a589562ab pretty print the c++ files yeah diff -r 9241ce1e5abe -r aac9a23bd027 decode.cpp --- a/decode.cpp Mon Jan 04 14:21:00 2021 -0500 +++ b/decode.cpp Mon Jan 04 14:22:32 2021 -0500 @@ -4,31 +4,27 @@ #include #include -int main(int argc, char *argv[]){ - if(argc != 3){ - std::cout << "usage: " << argv[0] << " "; - return 0; - } - std::string encoded; - CURL *curl = curl_easy_init(); - char somedata[256]; - std::ifstream in(argv[1], std::ios::in | std::ios::binary); - if (in) - { - in.seekg(0, std::ios::end); - encoded.resize(in.tellg()); - in.seekg(0, std::ios::beg); - in.read(&encoded[0], encoded.size()); - in.close(); - } - int outlength; - char *cres = curl_easy_unescape(curl, encoded.c_str(), encoded.length(), &outlength); +int main(int argc, char * argv[]) { + if (argc != 3) { + std::cout << "usage: " << argv[0] << " "; + return 0; + } + std::string encoded; + CURL * curl = curl_easy_init(); + char somedata[256]; + std::ifstream in (argv[1], std::ios:: in | std::ios::binary); + if (in) { + in .seekg(0, std::ios::end); + encoded.resize( in .tellg()); in .seekg(0, std::ios::beg); in .read( & encoded[0], encoded.size()); in .close(); + } + int outlength; + char * cres = curl_easy_unescape(curl, encoded.c_str(), encoded.length(), & outlength); std::string res(cres, cres + outlength); curl_free(cres); curl_easy_cleanup(curl); - std::ofstream myfile2; - myfile2.open(argv[2]); - myfile2 << res; - myfile2.close(); - return 0; -} + std::ofstream myfile2; + myfile2.open(argv[2]); + myfile2 << res; + myfile2.close(); + return 0; +} \ No newline at end of file