From 89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:44:50 -0500 Subject: Second Life viewer sources 1.14.0.0 --- linden/indra/win_updater/updater.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'linden/indra/win_updater/updater.cpp') diff --git a/linden/indra/win_updater/updater.cpp b/linden/indra/win_updater/updater.cpp index 20e41a8..e41ab00 100644 --- a/linden/indra/win_updater/updater.cpp +++ b/linden/indra/win_updater/updater.cpp @@ -33,6 +33,7 @@ #include #include +#include "llpreprocessor.h" #include "llfile.h" #define BUFSIZE 8192 @@ -81,7 +82,7 @@ int WINAPI get_url_into_file(WCHAR *uri, char *path, int *cancelled) *cancelled = FALSE; HINTERNET hinet, hdownload; - char data[BUFSIZE]; + char data[BUFSIZE]; /* Flawfinder: ignore */ unsigned long bytes_read; #if _DEBUG @@ -89,7 +90,7 @@ int WINAPI get_url_into_file(WCHAR *uri, char *path, int *cancelled) fflush(logfile); #endif - FILE *fp = fopen(path, "wb"); + FILE* fp = fopen(path, "wb"); /* Flawfinder: ignore */ if (!fp) { @@ -132,7 +133,7 @@ int WINAPI get_url_into_file(WCHAR *uri, char *path, int *cancelled) { #if _DEBUG DWORD err = GetLastError(); - fprintf(logfile,"InternetQueryDataAvailable Failed: %d bytes\n",total_bytes); + fprintf(logfile,"InternetQueryDataAvailable Failed: %d bytes Err:%d\n",total_bytes,err); fflush(logfile); #endif return success; @@ -320,7 +321,7 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho const int MAX_ARGS = 100; int argc = 0; - char *argv[MAX_ARGS]; + char* argv[MAX_ARGS]; /* Flawfinder: ignore */ #if _DEBUG logfile = _wfopen(TEXT("updater.log"),TEXT("wt")); @@ -346,7 +347,7 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho { argv[argc++] = token; /* Get next token: */ - if (*(token + strlen(token) + 1) == '\"') + if (*(token + strlen(token) + 1) == '\"') /* Flawfinder: ignore */ { token = strtok( NULL, "\""); } @@ -379,7 +380,7 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho if (gProductName) { mbstowcs(window_title, gProductName, 2048); - wcscat(window_title, L" Updater"); + wcscat(window_title, L" Updater"); /* Flawfinder: ignore */ } else { @@ -388,7 +389,7 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho WNDCLASSEX wndclassex = { 0 }; DEVMODE dev_mode = { 0 }; - char update_exec_path[MAX_PATH]; + char update_exec_path[MAX_PATH]; /* Flawfinder: ignore */ char *ptr; WCHAR update_uri[4096]; @@ -457,10 +458,10 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho *(ptr + 2) = 'x'; *(ptr + 3) = 'e'; *(ptr + 4) = 0; - wcscpy(update_uri, UPDATE_URIBASE); + wcscpy(update_uri, UPDATE_URIBASE); /* Flawfinder: ignore */ WCHAR wcmdline[2048]; mbstowcs(wcmdline, gUserServer, 2048); - wcscat(update_uri, wcmdline); + wcscat(update_uri, wcmdline); /* Flawfinder: ignore */ int success; int cancelled; @@ -503,18 +504,18 @@ WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho } // Construct some parameters. - char params[2048]; + char params[2048]; /* Flawfinder: ignore */ if (gIsSilent && gProgramName) { - sprintf(params, "/S /P=\"%s\"", gProgramName); + snprintf(params, sizeof(params), "/S /P=\"%s\"", gProgramName); /* Flawfinder: ignore */ } else if (gProgramName) { - sprintf(params, "/P=\"%s\"", gProgramName); + snprintf(params, sizeof(params), "/P=\"%s\"", gProgramName); /* Flawfinder: ignore */ } else if (gIsSilent) { - sprintf(params, "/S"); + sprintf(params, "/S"); /* Flawfinder: ignore */ } else { -- cgit v1.1