<commit_before>//#define _CRT_SECURE_NO_WARNINGS

#define WIN32_LEAN_AND_MEAN
#define STRICT
#define NOMINMAX
//#define _WIN32_WINNT 0x0400

#include <windows.h>
#include <vector>
#include <map>
#include <set>
#include <io.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <strsafe.h>
#include <Shlobj.h>
#include <Shlwapi.h>
#include <algorithm>
#include <string>
#include <sstream>

// _____________________________________________________________________ //
//
// Data
// _____________________________________________________________________ //
static std::vector<RECT> DesiredMonitorPlacements;
static std::map<HWND, WINDOWPLACEMENT> WindowPlacements;
static std::map<HWND, WINDOWPLACEMENT> PendingUpdates0;
static std::map<HWND, WINDOWPLACEMENT> PendingUpdates1;
static bool IsUpdateScheduled;
static bool IsPaused;
static HWND DetectWindow;
static UINT_PTR ResumeTimer;
static int ResumeTimerValue = 1000;
static int ScheduleTimerValue = 1000;
static int logfile;



// _____________________________________________________________________ //
//
// Helpers
// _____________________________________________________________________ //
int clamp(int min, int max, int value)
{
	return std::min(std::max(min, value), max);
}

void Log(const char* fmt, ...)
{
	static std::vector<char> buf;
	va_list	args;
	va_start(args, fmt);
	int len = _vscprintf(fmt, args);
	if(len >= (int)buf.size())
		buf.resize(len + 1);
	len = _vsnprintf_s(buf.data(), buf.size(), buf.size(), fmt, args);
	va_end(args);<commit_msg>Fixed buffer overrun bug (#5)<commit_after>//#define _CRT_SECURE_NO_WARNINGS

#define WIN32_LEAN_AND_MEAN
#define STRICT
#define NOMINMAX
//#define _WIN32_WINNT 0x0400

#include <windows.h>
#include <vector>
#include <map>
#include <set>
#include <io.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <strsafe.h>
#include <Shlobj.h>
#include <Shlwapi.h>
#include <algorithm>
#include <string>
#include <sstream>

// _____________________________________________________________________ //
//
// Data
// _____________________________________________________________________ //
static std::vector<RECT> DesiredMonitorPlacements;
static std::map<HWND, WINDOWPLACEMENT> WindowPlacements;
static std::map<HWND, WINDOWPLACEMENT> PendingUpdates0;
static std::map<HWND, WINDOWPLACEMENT> PendingUpdates1;
static bool IsUpdateScheduled;
static bool IsPaused;
static HWND DetectWindow;
static UINT_PTR ResumeTimer;
static int ResumeTimerValue = 1000;
static int ScheduleTimerValue = 1000;
static int logfile;



// _____________________________________________________________________ //
//
// Helpers
// _____________________________________________________________________ //
int clamp(int min, int max, int value)
{
	return std::min(std::max(min, value), max);
}

void Log(const char* fmt, ...)
{
	static std::vector<char> buf;
	va_list	args;
	va_start(args, fmt);
	int len = _vscprintf(fmt, args);
	if(len >= (int)buf.size())
		buf.resize(len + 1);
	len = _vsnprintf_s(buf.data(), buf.size(), len, fmt, args);
	va_end(args);
{'fraction_non_alphanumeric': 0.12471131639722864, 'fraction_numerical': 0.013526888815572418, 'mean_word_length': 6.5049504950495045, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4856330', 'n_tokens_mistral': 1005, 'n_tokens_neox': 954, 'n_words': 231}