From b6c8a3bce923b98c8b980a8b320d1e9c2ac076c5 Mon Sep 17 00:00:00 2001 From: Wonnam Jang Date: Thu, 12 Apr 2018 20:23:34 +0900 Subject: [PATCH] Correct to check return of fread Change-Id: I59e5b05bc4e6586b086112e919cd335a8feca2fd Signed-off-by: Wonnam Jang --- client/stt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/stt.c b/client/stt.c index 32b2534..8a55d34 100644 --- a/client/stt.c +++ b/client/stt.c @@ -105,7 +105,7 @@ static bool __check_privilege(const char* uid, const char * privilege) fp = fopen(label_path, "r"); if (fp != NULL) { - if (sizeof(smack_label) != fread(smack_label, 1, sizeof(smack_label), fp)) + if (0 >= fread(smack_label, 1, sizeof(smack_label), fp)) SLOG(LOG_ERROR, TAG_STTC, "[ERROR] fail to fread"); fclose(fp); -- 2.7.4