From: VMware, Inc <> Date: Sat, 28 May 2011 20:05:41 +0000 (-0700) Subject: BSD printf: missing ifdef X-Git-Tag: 2011.05.27-420096~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a67ca2639d9acd9c8a9c901dc1272b3352ab288a;p=thirdparty%2Fopen-vm-tools.git BSD printf: missing ifdef Add a missing ifdef. Prevent what looks like uninitialized variable usage. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/string/bsd_vsnprintf.c b/open-vm-tools/lib/string/bsd_vsnprintf.c index 18d5bc7db..703ee1459 100644 --- a/open-vm-tools/lib/string/bsd_vsnprintf.c +++ b/open-vm-tools/lib/string/bsd_vsnprintf.c @@ -458,7 +458,7 @@ bsd_vsnprintf_core(char **outbuf, double dbl; long double ldbl; } fparg; - int expt; /* integer value of exponent */ + int expt = 0; /* integer value of exponent */ char expchar; /* exponent character: [eEpP\0] */ char *dtoaend; /* pointer to end of converted digits */ int expsize; /* character count for expstr */ @@ -1231,11 +1231,13 @@ bsd_vsnprintf_core(char **outbuf, PRINT(&sign, 1); } +#if !defined(NO_FLOATING_POINT) /* NAN, INF and -INF */ if ((flags & FPT) && (expt == INT_MAX)) { PRINT(cp, size); goto skip; } +#endif if (ox[1]) { /* ox[1] is either x, X, or \0 */ ox[0] = '0';