Author: sebor Date: Tue Sep 20 18:52:25 2005 New Revision: 290598 URL: http://svn.apache.org/viewcvs?rev=290598&view=rev Log: 2005-09-20 Martin Sebor * printf.cpp (libstd_vasnprintf): Extended the %{m} specifier to handle width as the errno value (instead of using the errno variable value). Modified: incubator/stdcxx/trunk/tests/src/printf.cpp Modified: incubator/stdcxx/trunk/tests/src/printf.cpp URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/src/printf.cpp?rev=290598&r1=290597&r2=290598&view=diff ============================================================================== --- incubator/stdcxx/trunk/tests/src/printf.cpp (original) +++ incubator/stdcxx/trunk/tests/src/printf.cpp Tue Sep 20 18:52:25 2005 @@ -21,6 +21,7 @@ // expand _TEST_EXPORT macros #define _RWSTD_TEST_SRC +#include #include #include // for assert @@ -574,7 +575,7 @@ break; } - case 'm': { // extension + case 'm': { // %m (popular extension) spec.param.i = errno; len = rw_fmterrno (spec, pbuf, pbufsize, spec.param.i); break; @@ -3045,7 +3046,10 @@ break; case 'm': // %{m} -- errno - len = rw_fmterrno (spec, pbuf, pbufsize, errno); + if (-1 == spec.width) + len = rw_fmterrno (spec, pbuf, pbufsize, errno); + else + len = rw_fmterrno (spec, pbuf, pbufsize, spec.width); break; case 'M': // %{M}, %{LM}