Skip to content

Commit

Permalink
Trying to fix error.c
Browse files Browse the repository at this point in the history
Signed-off-by: Sourav Moitra <[email protected]>
  • Loading branch information
xw19 committed Dec 14, 2024
1 parent d526bc8 commit 10cd12c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libcrun/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,28 +391,28 @@ make_json_error (const char *msg, int errno_, int verbosity)
stat = json_object_set (root, (const char *)"msg", json_string(msg));
if (stat != JSON_GEN_FAILED)
{
sprintf(err, "Error code %d", stat);
err = strdup("json gen failed");
return err;
}

stat = json_object_set (root, (const char *)"level", json_string(level));
if (stat != JSON_GEN_FAILED)
{
sprintf(err, "Error code %d", stat);
err = strdup("json gen failed");
return err;
}

stat = json_object_set (root, (const char *)"time", json_string(timestamp));
if (stat != JSON_GEN_FAILED)
{
sprintf(err, "Error code %d", stat);
err = strdup("json gen failed");
return err;
}

ret = json_dumps(root, JSON_INDENT(2));
if (ret == NULL)
{
sprintf(err, "JSON Generation failed %d", JSON_GEN_FAILED);
err = strdup("json gen failed");
return err;
}

Expand Down

0 comments on commit 10cd12c

Please sign in to comment.