added clear to the miracle command set and valerie api
[melted] / src / miracle / miracle_commands.c
index 3a5db91..178f7f9 100644 (file)
@@ -130,6 +130,7 @@ response_codes miracle_list_units( command_argument cmd_arg )
                        valerie_response_printf( cmd_arg->response, 1024, "U%d %02d %s %d\n", i, node, constructor, online );
                }
        }
+       valerie_response_printf( cmd_arg->response, 1024, "\n" );
 
        return error;
 }
@@ -210,7 +211,7 @@ response_codes miracle_set_global_property( command_argument cmd_arg )
                strncpy( cmd_arg->root_dir, value, 1023 );
 
                /* add a trailing slash if needed */
-               if ( cmd_arg->root_dir[ len - 1 ] != '/')
+               if ( len && cmd_arg->root_dir[ len - 1 ] != '/')
                {
                        cmd_arg->root_dir[ len ] = '/';
                        cmd_arg->root_dir[ len + 1 ] = '\0';