Skip to content

Commit

Permalink
Fix inconsistency between Set and ToString in OctalField (#1151)
Browse files Browse the repository at this point in the history
  • Loading branch information
PragmaTwice authored Dec 2, 2022
1 parent a8bf8cd commit 606ac90
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/config/config_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

#pragma once

#include <fmt/format.h>

#include <string>
#include <utility>

Expand Down Expand Up @@ -126,7 +128,7 @@ class OctalField : public ConfigField {
public:
OctalField(int *receiver, int n, int min, int max) : receiver_(receiver), min_(min), max_(max) { *receiver_ = n; }
~OctalField() override = default;
std::string ToString() override { return std::to_string(*receiver_); }
std::string ToString() override { return fmt::format("{:o}", *receiver_); }
Status ToNumber(int64_t *n) override {
*n = *receiver_;
return Status::OK();
Expand Down

0 comments on commit 606ac90

Please sign in to comment.