diff options
author | Chris Hall <chris.hall@highwayman.com> | 2011-03-29 14:22:37 +0100 |
---|---|---|
committer | Chris Hall <chris.hall@highwayman.com> | 2011-03-29 14:22:37 +0100 |
commit | 7e666be965b3ac61b05ccdeca2b61902bc26e172 (patch) | |
tree | dc4c1b7985b1aa3dfd16b59c70567f62ab535fd6 /lib/qfstring.c | |
parent | f9956b9524ddafdb9d0cec042213eaa8229aad8c (diff) | |
parent | e20f7ccd9e110fcd5deb945f8d23922efd8b0822 (diff) | |
download | quagga-ex16p.tar.bz2 quagga-ex16p.tar.xz |
Merge branch 'master' of /git/quagga.euro-ix into pipeworkex16p
This ensures that the two branches are consistent after the merging
of the old-Quagga 0.99.18 changes.
Release: 0.99.18ex16p.
Eliminated some whitespace differences !
Collected RESTRICTED_NODE show_bgp_ipv6_safi_route_cmd and
show_bgp_ipv6_safi_prefix_cmd, and one HAVE_IPV6 skip. Also releasing
filename in closezlog().
Removed strlen() from lib/qfstring.c for async-signal-safe purposes.
Diffstat (limited to 'lib/qfstring.c')
-rw-r--r-- | lib/qfstring.c | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/lib/qfstring.c b/lib/qfstring.c index 25558797..2d5f69cc 100644 --- a/lib/qfstring.c +++ b/lib/qfstring.c @@ -523,23 +523,41 @@ qfs_number(qf_str qfs, uintmax_t val, int sign, enum pf_flags flags, /* Set up any required sign and radix prefix */ if ((flags & pf_unsigned) || (sign == 0)) - sign_str = "" ; + { + sign_str = "" ; + sign_len = 0 ; + } else if (sign < 0) - sign_str = "-" ; + { + sign_str = "-" ; + sign_len = 1 ; + } else if (flags & pf_plus) - sign_str = "+" ; + { + sign_str = "+" ; + sign_len = 1 ; + } else if (flags & pf_space) - sign_str = " " ; + { + sign_str = " " ; + sign_len = 1 ; + } else - sign_str = "" ; - - sign_len = strlen(sign_str) ; + { + sign_str = "" ; + sign_len = 0 ; + } ; - radix_str = "" ; if ((flags & (pf_hex | pf_alt)) == (pf_hex | pf_alt)) - radix_str = (flags & pf_uc) ? "0X" : "0x" ; - - radix_len = strlen(radix_str) ; + { + radix_str = (flags & pf_uc) ? "0X" : "0x" ; + radix_len = 2 ; + } + else + { + radix_str = "" ; + radix_len = 0 ; + } ; /* Turn off zero fill if left justify (width < 0) */ if (width < 0) |