From a00ce5ecdad3d4749f5c48ede9bc212daed3ca6b Mon Sep 17 00:00:00 2001 From: rilysh Date: Fri, 15 Sep 2023 01:03:03 -0400 Subject: [PATCH] use nullptr instead zero --- csv.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/csv.h b/csv.h index 0adf9c0..d25343e 100644 --- a/csv.h +++ b/csv.h @@ -137,7 +137,7 @@ class OwningStdIOByteSourceBase : public ByteSourceBase { public: explicit OwningStdIOByteSourceBase(FILE *file) : file(file) { // Tell the std library that we want to do the buffering ourself. - std::setvbuf(file, 0, _IONBF, 0); + std::setvbuf(file, nullptr, _IONBF, 0); } int read(char *buffer, int size) { return std::fread(buffer, 1, size, file); } @@ -306,7 +306,7 @@ class LineReader { // We open the file in binary mode as it makes no difference under *nix // and under Windows we handle \r\n newlines ourself. FILE *file = std::fopen(file_name, "rb"); - if (file == 0) { + if (file == nullptr) { int x = errno; // store errno as soon as possible, doing it after // constructor call can fail. error::can_not_open_file err; @@ -845,7 +845,7 @@ void parse_header_line(char *line, std::vector &col_order, } found[i] = true; col_order.push_back(i); - col_begin = 0; + col_begin = nullptr; break; } if (col_begin) {