Commit f4a2ac55976524a1655186ae622eb20493a673f6
1 parent
2b8da09d
Exists in
master
and in
1 other branch
Altera tamanho da alocação da variável [id] para automático
Showing
1 changed file
with
4 additions
and
4 deletions
Show diff stats
main.cpp
... | ... | @@ -176,7 +176,7 @@ int main(int argc, char* argv[]) { |
176 | 176 | void serviceSRT(int service, string path_video, string path_srt, int language, int position, int size, int background, string id, int mode){ |
177 | 177 | char* video = new char[MAX_SIZE_PATH]; |
178 | 178 | char* srt = new char[MAX_SIZE_PATH]; |
179 | - char* name = new char[64]; | |
179 | + char* name = new char[id.size()]; | |
180 | 180 | |
181 | 181 | strcpy(video, path_video.c_str()); |
182 | 182 | strcpy(srt, path_srt.c_str()); |
... | ... | @@ -206,7 +206,7 @@ void serviceSRT(int service, string path_video, string path_srt, int language, i |
206 | 206 | |
207 | 207 | void serviceREC(int service, string path_video, int position, int size, int background, string id, int mode){ |
208 | 208 | char* video = new char[MAX_SIZE_PATH]; |
209 | - char* name = new char[64]; | |
209 | + char* name = new char[id.size()]; | |
210 | 210 | |
211 | 211 | strcpy(video, path_video.c_str()); |
212 | 212 | strcpy(name, id.c_str()); |
... | ... | @@ -234,7 +234,7 @@ void serviceREC(int service, string path_video, int position, int size, int back |
234 | 234 | |
235 | 235 | void serviceText(string path_text, int language, int background, string id, int mode){ |
236 | 236 | char* text = new char[MAX_SIZE_PATH]; |
237 | - char* name = new char[64]; | |
237 | + char* name = new char[id.size()]; | |
238 | 238 | |
239 | 239 | strcpy(text, path_text.c_str()); |
240 | 240 | strcpy(name, id.c_str()); |
... | ... | @@ -263,7 +263,7 @@ void serviceText(string path_text, int language, int background, string id, int |
263 | 263 | |
264 | 264 | void serviceOnlySRT(int service, string path_srt, int language, int background, string id, int mode){ |
265 | 265 | char* srt = new char[MAX_SIZE_PATH]; |
266 | - char* name = new char[64]; | |
266 | + char* name = new char[id.size()]; | |
267 | 267 | |
268 | 268 | strcpy(srt, path_srt.c_str()); |
269 | 269 | strcpy(name, id.c_str()); | ... | ... |