Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
Addressing:
sce_engine.c: In function ‘sce_check_result_export’:
sce_engine.c:204:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (ret < strlen(v->std_out))
          ^
sce_engine.c:205:3: warning: implicit declaration of function ‘dE’ [-Wimplicit-function-declaration]
   dE("Failed to write stdout result to %s.\n", target_file);
   ^~
sce_engine.c:209:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (ret < strlen(v->std_err))
          ^
  • Loading branch information
jan-cerny committed Mar 21, 2017
1 parent d1a5c32 commit ba6ff36
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/SCE/sce_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "common/list.h"
#include "common/oscap_acquire.h"
#include "common/oscap_string.h"
#include "common/debug_priv.h"
#include "sce_engine_api.h"

#include <stdlib.h>
Expand Down Expand Up @@ -200,14 +201,14 @@ void sce_check_result_export(struct sce_check_result* v, const char* target_file
oscap_string_iterator_free(it);
fprintf(f, "\t</sceres:environment>\n");
fprintf(f, "\t<sceres:stdout><![CDATA[\n");
int ret = fwrite(v->std_out, 1, strlen(v->std_out), f);
size_t ret = fwrite(v->std_out, 1, strlen(v->std_out), f);
if (ret < strlen(v->std_out))
dE("Failed to write stdout result to %s.\n", target_file);
oscap_seterr(OSCAP_EFAMILY_SCE, "Failed to write stdout result to %s.\n", target_file);
fprintf(f, "\t]]></sceres:stdout>\n");
fprintf(f, "\t<sceres:stderr><![CDATA[\n");
ret = fwrite(v->std_err, 1, strlen(v->std_err), f);
if (ret < strlen(v->std_err))
dE("Failed to write stderr result to %s.\n", target_file);
oscap_seterr(OSCAP_EFAMILY_SCE, "Failed to write stderr result to %s.\n", target_file);
fprintf(f, "\t]]></sceres:stderr>\n");
fprintf(f, "\t<sceres:exit_code>%i</sceres:exit_code>\n", sce_check_result_get_exit_code(v));
fprintf(f, "\t<sceres:result>%s</sceres:result>\n", xccdf_test_result_type_get_text(sce_check_result_get_xccdf_result(v)));
Expand Down

0 comments on commit ba6ff36

Please sign in to comment.