]> Savannah Git Hosting - gnulib.git/commit
strftime: wrap macros in "do {...} while(0)"
authorBernhard Voelker <mail@bernhard-voelker.de>
Wed, 26 Mar 2014 01:45:58 +0000 (02:45 +0100)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 26 Mar 2014 03:27:02 +0000 (20:27 -0700)
commit2d6dfaca3e462714bd5220732387b9770733d42a
tree434b6fd632d6fed673d4155dfced6c55da5a1a44
parent9b784e734cbabe0d25bcf0f845a75674af699342
strftime: wrap macros in "do {...} while(0)"

* lib/strftime.c (DO_NUMBER): Wrap multi-statement code block of
this macro in "do {...} while(0)" to prevent false use as a
single statement, e.g., in an un-braced "{}" else-block.
(DO_SIGNED_NUMBER, DO_TZ_OFFSET, DO_NUMBER_SPACEPAD): Likewise.
(strftime_case_): Remove 'else' after 'goto' - which was the
only non-fatal, un-braced use of one of the above macros.
Spotted by coverity (NESTING_INDENT_MISMATCH).
ChangeLog
lib/strftime.c