From: Earl Hood Date: Sat, 6 Feb 2010 07:45:47 +0000 (+0000) Subject: Fixed variable declaration so older compilers will not complain. X-Git-Tag: PRE_POSIX_CONVERSION~2 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=b7c348e99fa223f370ebdb4fd9b6627596c66a08 Fixed variable declaration so older compilers will not complain. I.e. Older compilers may not support C99, so variables must be declared at the beginning of a block. --- diff --git a/sbr/m_mktemp.c b/sbr/m_mktemp.c index 2229036..59ee37d 100644 --- a/sbr/m_mktemp.c +++ b/sbr/m_mktemp.c @@ -109,6 +109,7 @@ m_mktemp2 ( { static char buffer[BUFSIZ]; char *cp; + int n; if (dir_in == NULL) { if (pfx_in == NULL) { @@ -122,7 +123,7 @@ m_mktemp2 ( /* No directory component */ return m_mktemp(pfx_in, fd_ret, fp_ret); } - int n = (int)(cp-dir_in-1); /* Length of dir component */ + n = (int)(cp-dir_in-1); /* Length of dir component */ snprintf(buffer, sizeof(buffer), "%.*s%s", n, dir_in, pfx_in); return m_mktemp(buffer, fd_ret, fp_ret); }