1 /* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * SPDX-License-Identifier: BSD-2-Clause 5 */ 6 7 #include <common.h> 8 #include <fastboot.h> 9 10 void fastboot_fail(const char *reason, char *response) 11 { 12 const char *fail_str = "FAIL"; 13 strncpy(response, fail_str, FASTBOOT_RESPONSE_LEN); 14 strncat(response, reason, FASTBOOT_RESPONSE_LEN - strlen(fail_str) - 1); 15 } 16 17 void fastboot_okay(const char *reason, char *response) 18 { 19 const char *okay_str = "OKAY"; 20 strncpy(response, okay_str, FASTBOOT_RESPONSE_LEN); 21 strncat(response, reason, FASTBOOT_RESPONSE_LEN - strlen(okay_str) - 1); 22 } 23