diff options
| author | Mark Stapp <mjs@voltanet.io> | 2021-03-31 09:10:30 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-31 09:10:30 -0400 |
| commit | e2efe13327adefb655811bdb03bb76b95db2407c (patch) | |
| tree | b9fa898013c23be16c8a50ee477af017ab52220a /lib/vty.c | |
| parent | fb639375cb2ca062f350c56c51367f2d8d5b2514 (diff) | |
| parent | 19b1a1c6a975f772b22dda9c5c42c6288e2ce459 (diff) | |
Merge pull request #8350 from opensourcerouting/printfrr-revamp
lib: `printfrr()` care package
Diffstat (limited to 'lib/vty.c')
| -rw-r--r-- | lib/vty.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -159,6 +159,8 @@ int vty_out(struct vty *vty, const char *format, ...) char buf[1024]; char *p = NULL; char *filtered; + /* format string may contain %m, keep errno intact for printfrr */ + int saved_errno = errno; if (vty->frame_pos) { vty->frame_pos = 0; @@ -166,6 +168,7 @@ int vty_out(struct vty *vty, const char *format, ...) } va_start(args, format); + errno = saved_errno; p = vasnprintfrr(MTYPE_VTY_OUT_BUF, buf, sizeof(buf), format, args); va_end(args); |
