From f4a2ac55976524a1655186ae622eb20493a673f6 Mon Sep 17 00:00:00 2001 From: Erickson Silva Date: Thu, 14 Apr 2016 12:02:54 -0300 Subject: [PATCH] Altera tamanho da alocação da variável [id] para automático --- main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index c252bbf..0ed6057 100644 --- a/main.cpp +++ b/main.cpp @@ -176,7 +176,7 @@ int main(int argc, char* argv[]) { void serviceSRT(int service, string path_video, string path_srt, int language, int position, int size, int background, string id, int mode){ char* video = new char[MAX_SIZE_PATH]; char* srt = new char[MAX_SIZE_PATH]; - char* name = new char[64]; + char* name = new char[id.size()]; strcpy(video, path_video.c_str()); strcpy(srt, path_srt.c_str()); @@ -206,7 +206,7 @@ void serviceSRT(int service, string path_video, string path_srt, int language, i void serviceREC(int service, string path_video, int position, int size, int background, string id, int mode){ char* video = new char[MAX_SIZE_PATH]; - char* name = new char[64]; + char* name = new char[id.size()]; strcpy(video, path_video.c_str()); strcpy(name, id.c_str()); @@ -234,7 +234,7 @@ void serviceREC(int service, string path_video, int position, int size, int back void serviceText(string path_text, int language, int background, string id, int mode){ char* text = new char[MAX_SIZE_PATH]; - char* name = new char[64]; + char* name = new char[id.size()]; strcpy(text, path_text.c_str()); strcpy(name, id.c_str()); @@ -263,7 +263,7 @@ void serviceText(string path_text, int language, int background, string id, int void serviceOnlySRT(int service, string path_srt, int language, int background, string id, int mode){ char* srt = new char[MAX_SIZE_PATH]; - char* name = new char[64]; + char* name = new char[id.size()]; strcpy(srt, path_srt.c_str()); strcpy(name, id.c_str()); -- libgit2 0.21.2