diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2018-01-02 09:20:35 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2018-01-02 09:20:35 +0300 |
commit | deac6d7a827d93e9ec68274b16f54a20d9eefb5e (patch) | |
tree | 7ea5e7b585d7369e748ee5085f5dc4522e28fd42 | |
parent | be2c5cc297eda50f94c3dc7946d8847d75135864 (diff) |
get rid of 1024 length limit for out dir path
-rw-r--r-- | sound_detector/main.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sound_detector/main.cpp b/sound_detector/main.cpp index 1385eea..6bffcb6 100644 --- a/sound_detector/main.cpp +++ b/sound_detector/main.cpp @@ -38,6 +38,7 @@ #include <limits> #include <vector> #include <fstream> +#include <string> //portaudio #include <portaudio.h> @@ -155,7 +156,7 @@ std::string time_str() #endif } -char out_dir[1024] = {0}; +std::string out_dir; void handle_data() @@ -322,7 +323,7 @@ int main(int argc, char **argv) stop_thresold_percent = strtof(optarg, NULL); break; case 'o': - strcpy(out_dir, optarg); + out_dir = optarg; break; case 'd': device = atoi(optarg); @@ -347,7 +348,7 @@ int main(int argc, char **argv) printf("ERROR: device number is required\n"); return 1; } - if(!out_dir[0]) + if(out_dir.empty()) { printf("ERROR: output directory is required\n"); return 1; |