From a73904e4c01766ef29722fd5b9d7ec0d4729792c Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Wed, 26 Mar 2025 14:54:48 -0400 Subject: pkuuid: reset ostream flags after serializing --- pkuuid.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkuuid.h') diff --git a/pkuuid.h b/pkuuid.h index 8639e87..0de7f6b 100644 --- a/pkuuid.h +++ b/pkuuid.h @@ -153,6 +153,8 @@ std::ostream& operator<<(std::ostream &o, const struct pk_uuid& uuid) { int i; + std::ios_base::fmtflags orig_flags = o.flags(); + auto fill = o.fill(); o << std::hex; for (i = 0; i < 4; ++i) { o << std::setw(2) << std::setfill('0'); @@ -178,6 +180,8 @@ operator<<(std::ostream &o, const struct pk_uuid& uuid) o << std::setw(2) << std::setfill('0'); o << (uint16_t)uuid.uuid[i]; } + o.fill(fill); + o.flags(orig_flags); return o; } -- cgit v1.2.3