[Spice-devel] [vdagent-win 1/2] vdlog: Get swprinft_s definition from vdcommon.h

Uri Lublin uril at redhat.com
Sun Dec 23 02:26:53 PST 2012


On 12/21/2012 12:28 PM, Christophe Fergeau wrote:
> vdlog.cpp has an #ifdef check for OLDMSVC to choose between using
> swprintf or swprintf_s. Since vdcommon.h provides a compat #define
> for swprintf_s when OLDMSVC is check, it's better to use this one.
> ---
>   common/vdlog.cpp | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/common/vdlog.cpp b/common/vdlog.cpp
> index f84b5b3..76f4297 100644
> --- a/common/vdlog.cpp
> +++ b/common/vdlog.cpp
> @@ -15,6 +15,7 @@
>      along with this program.  If not, see<http://www.gnu.org/licenses/>.
>   */
>
> +#include "vdcommon.h"
>   #include "vdlog.h"
>   #include<stdio.h>
>   #include<stdarg.h>
> @@ -52,11 +53,7 @@ VDLog* VDLog::get(TCHAR* path)
>       }
>       if (size != INVALID_FILE_SIZE&&  size>  LOG_ROLL_SIZE) {
>           TCHAR roll_path[MAX_PATH];
> -#ifdef OLDMSVCRT
> -        swprintf(roll_path, L"%s.1", path);
> -#else
>           swprintf_s(roll_path, MAX_PATH, L"%s.1", path);
> -#endif
>           if (!MoveFileEx(path, roll_path, MOVEFILE_REPLACE_EXISTING)) {
>               return NULL;
>           }

Ack.


More information about the Spice-devel mailing list