Skip to content

Commit

Permalink
Increased max log string length
Browse files Browse the repository at this point in the history
  • Loading branch information
mvsoft74 committed Jul 11, 2018
1 parent 54d524a commit 386e78e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
15 changes: 9 additions & 6 deletions audio/log.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#include <stdio.h>
#include <windows.h>
// log.cpp

#include "log.h"

#define LOG_SIZE 512

//LPCTSTR UNICODE _UNICODE

//--------------------------------------------------

//LPCSTR
void LOGA(LPCSTR format, ...) {
char output_buff[256];
char output_buff[LOG_SIZE];

char err[20] = ""; //"Warn: ";
int sl = strnlen_s(err, 20);
Expand All @@ -23,7 +26,7 @@ void LOGA(LPCSTR format, ...) {

//LPCWSTR
void LOG(LPCWSTR format, ...) {
wchar_t output_buff[256];
wchar_t output_buff[LOG_SIZE];

wchar_t err[20] = L""; //L"Warn: ";
int sl = wcsnlen_s(err, 20);
Expand All @@ -41,7 +44,7 @@ void LOG(LPCWSTR format, ...) {

//LPCSTR
void ERRA(LPCSTR format, ...) {
char output_buff[256];
char output_buff[LOG_SIZE];

char err[20] = "Error: ";
int sl = strnlen_s(err, 20);
Expand All @@ -57,7 +60,7 @@ void ERRA(LPCSTR format, ...) {

//LPCWSTR
void ERR(LPCWSTR format, ...) {
wchar_t output_buff[256];
wchar_t output_buff[LOG_SIZE];

wchar_t err[20] = L"Error: ";
int sl = wcsnlen_s(err, 20);
Expand Down
3 changes: 3 additions & 0 deletions audio/log.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// log.h

#include <stdio.h>
#include <windows.h>

//#define LOG(format, ...) wprintf(format L"\n", __VA_ARGS__)
//#define ERR(format, ...) LOG(L"Error: " format, __VA_ARGS__)

Expand Down

0 comments on commit 386e78e

Please sign in to comment.