Skip to content

Commit

Permalink
RDKBDEV-2826: check fread() return values to avoid compiler warnings (#…
Browse files Browse the repository at this point in the history
…212)

Reason for change:
void compiler warnings
Test Procedure: Sanity.
Risks: None.

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Co-authored-by: Andre McCurdy <armccurdy@gmail.com>
  • Loading branch information
2 people authored and karuna2git committed Jan 6, 2025
1 parent 0eb1f56 commit 1878806
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/rbus/rbus_config.c
Original file line number Diff line number Diff line change
@@ -98,8 +98,8 @@ int rbusConfig_ReadGetTimeout()
{
fp = fopen(RBUS_GET_TIMEOUT_OVERRIDE, "r");
if(fp != NULL) {
fread(buf, 1, sizeof(buf), fp);
timeout = atoi(buf);
if (fread(buf, 1, sizeof(buf), fp) > 0)
timeout = atoi(buf);
fclose(fp);
}
if (timeout > 0)
@@ -119,8 +119,8 @@ int rbusConfig_ReadWildcardGetTimeout()
{
fp = fopen(RBUS_GET_WILDCARD_TIMEOUT_OVERRIDE, "r");
if(fp != NULL) {
fread(buf, 1, sizeof(buf), fp);
timeout = atoi(buf);
if (fread(buf, 1, sizeof(buf), fp) > 0)
timeout = atoi(buf);
fclose(fp);
}
if (timeout > 0)
@@ -140,8 +140,8 @@ int rbusConfig_ReadSetTimeout()
{
fp = fopen(RBUS_SET_TIMEOUT_OVERRIDE, "r");
if(fp != NULL) {
fread(buf, 1, sizeof(buf), fp);
timeout = atoi(buf);
if (fread(buf, 1, sizeof(buf), fp) > 0)
timeout = atoi(buf);
fclose(fp);
}
if (timeout > 0)

0 comments on commit 1878806

Please sign in to comment.