@@ -137,7 +137,7 @@ static int do_one_item(char item_type_char, const std::string ¶m_name, const
137137 litem[idx] = strtol (param_value.c_str (), &endp, 0 );
138138 if (*endp) {
139139 rtapi_print_msg (RTAPI_MSG_ERR,
140- " `%s' invalid for parameter `%s'" ,
140+ " `%s' invalid for parameter `%s'\n " ,
141141 param_value.c_str (), param_name.c_str ());
142142 return -1 ;
143143 }
@@ -148,7 +148,7 @@ static int do_one_item(char item_type_char, const std::string ¶m_name, const
148148 iitem[idx] = strtol (param_value.c_str (), &endp, 0 );
149149 if (*endp) {
150150 rtapi_print_msg (RTAPI_MSG_ERR,
151- " `%s' invalid for parameter `%s'" ,
151+ " `%s' invalid for parameter `%s'\n " ,
152152 param_value.c_str (), param_name.c_str ());
153153 return -1 ;
154154 }
@@ -458,20 +458,13 @@ static int master(int fd, const std::vector<std::string>& args) {
458458static std::string
459459get_fifo_path () {
460460 std::string s;
461- if (getenv (" RTAPI_FIFO_PATH" ))
461+ if (getenv (" RTAPI_FIFO_PATH" )){
462462 s = getenv (" RTAPI_FIFO_PATH" );
463- else if (getenv (" HOME" ))
463+ } else if (getenv (" HOME" )){
464464 s = std::string (getenv (" HOME" )) + " /.rtapi_fifo" ;
465- else {
466- rtapi_print_msg (RTAPI_MSG_ERR,
467- " rtapi_app: RTAPI_FIFO_PATH and HOME are unset. rtapi fifo creation is unsafe." );
468- return std::string ();
469- }
470- if (s.size () + 1 > sizeof (sockaddr_un::sun_path)) {
465+ }else {
471466 rtapi_print_msg (RTAPI_MSG_ERR,
472- " rtapi_app: rtapi fifo path is too long (arch limit %zd): %s" ,
473- sizeof (sockaddr_un::sun_path), s.c_str ());
474- return std::string ();
467+ " rtapi_app: RTAPI_FIFO_PATH and HOME are unset. rtapi fifo creation is unsafe.\n " );
475468 }
476469 return s;
477470}
@@ -480,7 +473,15 @@ static int
480473get_fifo_path (char *buf, size_t bufsize) {
481474 int len;
482475 const std::string s = get_fifo_path ();
483- if (s.empty ()) return -1 ;
476+ if (s.empty ()){
477+ return -1 ;
478+ }
479+ if (s.size () + 1 > sizeof (sockaddr_un::sun_path)) {
480+ rtapi_print_msg (RTAPI_MSG_ERR,
481+ " rtapi_app: rtapi fifo path is too long (arch limit %zd): %s\n " ,
482+ sizeof (sockaddr_un::sun_path), s.c_str ());
483+ return -1 ;
484+ }
484485 len=snprintf (buf+1 , bufsize-1 , " %s" , s.c_str ());
485486 return len;
486487}
0 commit comments