Browse Source

modemm17: Restore ostream format after printing AX.25 PID

Fix Coverity CID 655956 by saving and restoring the stream
format flags around the hexadecimal PID output. This prevents
the basefield setting from affecting subsequent output.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
chirpmodem-v8.1.0
Robin Getz 4 weeks ago
parent
commit
acd3af86ab
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 2
      modemm17/ax25_frame.h

2
modemm17/ax25_frame.h

@ -256,7 +256,9 @@ void write(std::ostream& os, const ax25_frame& frame) @@ -256,7 +256,9 @@ void write(std::ostream& os, const ax25_frame& frame)
if (frame.pid())
{
std::ios_base::fmtflags flags = os.flags();
os << "PID: " << std::setbase(16) << int(frame.pid()) << std::endl;
os.flags(flags);
}
os << "Info: " << std::endl << frame.info() << std::endl;
}

Loading…
Cancel
Save