@@ -170,7 +170,7 @@ void NML::operator delete(void *nml_space)
170170* later if the constructor returned before creating the objects
171171* the pointers are intended to point at.
172172******************************************************************/
173- NML::NML (NML_FORMAT_PTR f_ptr, const char * const buf, const char * const proc, const char * const file,
173+ NML::NML (NML_FORMAT_PTR f_ptr, const char *buf, const char *proc, const char *file,
174174 const int set_to_server, const int set_to_master)
175175{
176176 registered_with_server = 0 ;
@@ -182,9 +182,11 @@ NML::NML(NML_FORMAT_PTR f_ptr, const char * const buf, const char * const proc,
182182 rtapi_strlcpy (bufname, buf, 40 );
183183 rtapi_strlcpy (procname, proc, 40 );
184184 if (NULL == file) {
185- file = default_nml_config_file;
185+ rtapi_strlcpy (cfgfilename, default_nml_config_file, 160 );
186+ }
187+ else {
188+ rtapi_strlcpy (cfgfilename, file, 160 );
186189 }
187- rtapi_strlcpy (cfgfilename, file, 160 );
188190
189191 if (rcs_errors_printed >= max_rcs_errors_to_print
190192 && max_rcs_errors_to_print > 0 && nml_reset_errors_printed) {
@@ -196,7 +198,7 @@ NML::NML(NML_FORMAT_PTR f_ptr, const char * const buf, const char * const proc,
196198 already_deleted = 0 ;
197199 channel_type = NML_GENERIC_CHANNEL_TYPE;
198200
199- reconstruct (f_ptr, buf, proc, file , set_to_server, set_to_master);
201+ reconstruct (f_ptr, buf, proc, cfgfilename , set_to_server, set_to_master);
200202
201203 if (NULL != cms) {
202204 char *forced_type_eq = strstr (cms->buflineupper , " FORCE_TYPE=" );
@@ -220,7 +222,7 @@ int NML::login(const char *name, const char *passwd)
220222}
221223
222224void NML::reconstruct (NML_FORMAT_PTR f_ptr, const char *buf, const char *proc,
223- const char *file, int set_to_server, int set_to_master)
225+ const char *file, const int set_to_server, const int set_to_master)
224226{
225227
226228 cms = (CMS *) NULL ;
@@ -252,8 +254,7 @@ void NML::reconstruct(NML_FORMAT_PTR f_ptr, const char *buf, const char *proc,
252254 print_info (buf, proc, file);
253255 }
254256 if (NULL != cms) {
255- rcs_print_debug (PRINT_NML_DESTRUCTORS, " delete (CMS *) %p;\n " ,
256- cms);
257+ rcs_print_debug (PRINT_NML_DESTRUCTORS, " delete (CMS *) %p;\n " , cms);
257258 delete cms;
258259 cms = (CMS *) NULL ;
259260 }
@@ -337,8 +338,8 @@ void NML::reconstruct(NML_FORMAT_PTR f_ptr, const char *buf, const char *proc,
337338* the format_chain is constructed. (This may be done by
338339* derived classes. )
339340******************************************************************/
340- NML::NML (const char *buf, const char *proc, const char *file, int set_to_server,
341- int set_to_master)
341+ NML::NML (const char *buf, const char *proc, const char *file, const int set_to_server,
342+ const int set_to_master)
342343{
343344 if (NULL == file) {
344345 file = default_nml_config_file;
@@ -456,7 +457,7 @@ NML::NML(const char *buf, const char *proc, const char *file, int set_to_server,
456457* the format_chain is constructed. (This may be done by
457458* derived classes. )
458459******************************************************************/
459- NML::NML (const char * const buffer_line, const char * const proc_line)
460+ NML::NML (const char * buffer_line, const char * proc_line)
460461{
461462 registered_with_server = 0 ;
462463 cms_for_msg_string_conversions = 0 ;
@@ -602,7 +603,7 @@ void NML::register_with_server()
602603* later if the constructor returned before creating the objects
603604* the pointers are intended to point at.
604605*************************************************************/
605- NML::NML (NML * nml_ptr, int set_to_server, int set_to_master)
606+ NML::NML (NML * nml_ptr, const int set_to_server, const int set_to_master)
606607{
607608 registered_with_server = 0 ;
608609 cms_for_msg_string_conversions = 0 ;
0 commit comments