fixed line end in cli:hw_info command (#503)
* fixed line end in cli:hw_info command * remove x0a from ctime() out * syntax fix * use reentrant verison of ctime Co-authored-by: DrZlo13 <who.just.the.doctor@gmail.com>
This commit is contained in:
		
							parent
							
								
									d5df0483a3
								
							
						
					
					
						commit
						8851a240ab
					
				| @ -101,7 +101,12 @@ void cli_command_hw_info(Cli* cli, string_t args, void* context) { | ||||
|         api_hal_version_get_hw_body(), | ||||
|         api_hal_version_get_hw_connect()); | ||||
|     time_t time = api_hal_version_get_hw_timestamp(); | ||||
|     printf("%-20s %s\r", "Production date:", ctime(&time)); | ||||
|     char time_string[26] = ""; | ||||
|     ctime_r(&time, time_string); | ||||
|     if(time_string[strlen(time_string) - 1] == '\n') { | ||||
|         time_string[strlen(time_string) - 1] = '\0'; | ||||
|     } | ||||
|     printf("%-20s %s\r\n", "Production date:", time_string); | ||||
|     const char* name = api_hal_version_get_name_ptr(); | ||||
|     if(name) { | ||||
|         printf("%-20s %s", "Name:", name); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Lesha Lomalkin
						Lesha Lomalkin