mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-12 19:04:59 +00:00
rma_reset: fix ignored return value error
The fread return value was ignored in rma_reset.c. This caused clang compilation to fail. This change checks the return value. BUG=b:76105747 BRANCH=none TEST=clang compilation no longer fails Change-Id: I710b367008b2e17a94c875ea3eae92bcc75546b0 Signed-off-by: Mary Ruthven <mruthven@google.com> Reviewed-on: https://chromium-review.googlesource.com/976555 Commit-Ready: Mary Ruthven <mruthven@chromium.org> Tested-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
This commit is contained in:
@@ -452,6 +452,7 @@ int main(int argc, char **argv)
|
||||
if (a_flag) {
|
||||
FILE *acode;
|
||||
char verify_authcode[RMA_AUTHCODE_BUF_SIZE];
|
||||
int rv;
|
||||
|
||||
acode = fopen("/tmp/authcode", "r");
|
||||
if (acode == NULL) {
|
||||
@@ -459,7 +460,11 @@ int main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
fread(verify_authcode, 1, RMA_AUTHCODE_BUF_SIZE, acode);
|
||||
rv = fread(verify_authcode, 1, RMA_AUTHCODE_BUF_SIZE, acode);
|
||||
if (rv != RMA_AUTHCODE_BUF_SIZE) {
|
||||
printf("Error reading saved authcode\n");
|
||||
return 1;
|
||||
}
|
||||
if (strcmp(verify_authcode, authcode) == 0)
|
||||
printf("Code Accepted\n");
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user