diff options
| author | Shauren <shauren.trinity@gmail.com> | 2017-01-23 18:42:29 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2017-01-23 18:42:29 +0100 |
| commit | 7b43adc436948b22b51db8965516ca4b503b030f (patch) | |
| tree | c70a65b9d9de08a4c91330c666969f7f66c58e95 /src/tools/vmap4_extractor | |
| parent | 1c00f0b2d405d5f9eee4009ca5810e9721cd36ce (diff) | |
Tools/Extractors: Use boost::filesystem for path manipulations
Fixes coverity issue CID 1324654
Diffstat (limited to 'src/tools/vmap4_extractor')
| -rw-r--r-- | src/tools/vmap4_extractor/vmapexport.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp index 1ec40b7bfd3..1541c71d14c 100644 --- a/src/tools/vmap4_extractor/vmapexport.cpp +++ b/src/tools/vmap4_extractor/vmapexport.cpp @@ -71,8 +71,7 @@ typedef struct std::vector<map_id> map_ids; std::vector<uint16> LiqType; uint32 map_count; -char output_path[128] = "."; -char input_path[1024] = "."; +boost::filesystem::path input_path; bool preciseVectorData = false; struct LiquidTypeMeta @@ -427,21 +426,17 @@ bool processArgv(int argc, char ** argv, const char *versionString) bool result = true; preciseVectorData = false; - for(int i = 1; i < argc; ++i) + for (int i = 1; i < argc; ++i) { - if(strcmp("-s",argv[i]) == 0) + if (strcmp("-s", argv[i]) == 0) { preciseVectorData = false; } - else if(strcmp("-d",argv[i]) == 0) + else if (strcmp("-d", argv[i]) == 0) { - if((i+1)<argc) + if ((i + 1) < argc) { - strncpy(input_path, argv[i + 1], sizeof(input_path)); - input_path[sizeof(input_path) - 1] = '\0'; - - if (input_path[strlen(input_path) - 1] != '\\' && input_path[strlen(input_path) - 1] != '/') - strcat(input_path, "/"); + input_path = boost::filesystem::path(argv[i + 1]); ++i; } else @@ -449,7 +444,7 @@ bool processArgv(int argc, char ** argv, const char *versionString) result = false; } } - else if(strcmp("-?",argv[1]) == 0) + else if (strcmp("-?", argv[1]) == 0) { result = false; } |
