@@ -1868,24 +1868,21 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
18681868
18691869 // retrieving the right default output filename,
18701870 // depending on the example program...
1871- std::string * out_file_ptr ;
1871+ const char * default_out_file ;
18721872
18731873 if (ex == LLAMA_EXAMPLE_EXPORT_LORA)
1874- out_file_ptr = & params.lora_outfile ;
1875-
1874+ default_out_file = params.lora_outfile .c_str ();
18761875 else if (ex == LLAMA_EXAMPLE_CVECTOR_GENERATOR)
1877- out_file_ptr = & params.cvector_outfile ;
1878-
1876+ default_out_file = params.cvector_outfile .c_str ();
18791877 else if (ex == LLAMA_EXAMPLE_TTS)
1880- out_file_ptr = & params.ttss_outfile ;
1881-
1878+ default_out_file = params.ttss_outfile .c_str ();
18821879 else // currently coded as "imatrix.dat", see common.h
1883- out_file_ptr = & params.out_file ;
1880+ default_out_file = params.out_file . c_str () ;
18841881
18851882 add_opt (common_arg (
18861883 {" -o" , " --output" , " --output-file" }, " FNAME" ,
18871884 string_format (" output file (default: '%s')" ,
1888- out_file_ptr-> c_str () ),
1885+ default_out_file ),
18891886 [](common_params & params, const std::string & value) {
18901887 params.out_file = value;
18911888 params.cvector_outfile = value;
0 commit comments