• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

swfから画像を抽出するコマンドラインアプリケーション


Commit MetaInfo

Revisiona45cb889232691051f3e7c7b08bc04943fac512d (tree)
Zeit2017-08-06 16:23:30
Autormasakih <masakih@user...>
Commitermasakih

Log Message

パス名の取得に失敗する問題を修正

Ändern Zusammenfassung

Diff

--- a/KanColleGraphicDivider/main.m
+++ b/KanColleGraphicDivider/main.m
@@ -478,11 +478,15 @@ int main(int argc, char * const *argv) {
478478 }
479479
480480 if(oFilename) {
481- outputDir = [NSString stringWithFormat:@"%s", oFilename];
481+ outputDir = [[NSString alloc] initWithUTF8String:oFilename];
482+ if( outputDir.length == 0 ) {
483+ fprintf(stderr, "Output directory:%s can not convert file represendation.\n", oFilename);
484+ exit(EXIT_FAILURE);
485+ }
482486 NSFileManager *fm = [NSFileManager defaultManager];
483487 BOOL isDir = NO;
484488 if(![fm fileExistsAtPath:outputDir isDirectory:&isDir] || !isDir) {
485- fprintf(stderr, "Output directory:%s is not found or not directory.", outputDir.fileSystemRepresentation);
489+ fprintf(stderr, "Output directory:%s is not found or not directory.\n", outputDir.UTF8String);
486490 exit(EXIT_FAILURE);
487491 }
488492 } else {
@@ -491,7 +495,7 @@ int main(int argc, char * const *argv) {
491495 }
492496
493497 if(charactorid) {
494- NSString *charactoridsString = [NSString stringWithFormat:@"%s", charactorid];
498+ NSString *charactoridsString = [[NSString alloc] initWithUTF8String:charactorid];
495499 NSArray *ids = [charactoridsString componentsSeparatedByString:@","];
496500 if(ids.count != 0) {
497501 charactorIds = ids;
@@ -507,7 +511,7 @@ int main(int argc, char * const *argv) {
507511 Information *info = [Information new];
508512 info.outputDir = outputDir;
509513 info.charctorIds = charactorIds;
510- info.filename = [NSString stringWithFormat:@"%s", filename];
514+ info.filename = [[NSString alloc] initWithUTF8String:filename];
511515
512516 dispatch_group_async(group, queue, ^{
513517 extractImagesFromSWFFile(info);