diff --git a/cpp/examples/protobuf/writer.cpp b/cpp/examples/protobuf/writer.cpp index f6c5cee784..1f571f19ee 100644 --- a/cpp/examples/protobuf/writer.cpp +++ b/cpp/examples/protobuf/writer.cpp @@ -129,7 +129,7 @@ int main(int argc, char** argv) { auto timestamp = pcl.mutable_timestamp(); timestamp->set_seconds(static_cast(cloudTime) / NS_PER_S); - timestamp->set_nanos(static_cast(cloudTime) % NS_PER_S); + timestamp->set_nanos(static_cast(cloudTime % NS_PER_S)); // write 1000 points into each pointcloud message. size_t offset = 0;