Commit 65b78ea3 by Pranit Bauva

use `giterr_set_str()` wherever possible

`giterr_set()` is used when it is required to format a string, and since
we don't really require it for this case, it is better to stick to
`giterr_set_str()`.

This also suppresses a warning(-Wformat-security) raised by the compiler.

Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
parent a6763ff9
...@@ -552,7 +552,7 @@ int git_index_clear(git_index *index) ...@@ -552,7 +552,7 @@ int git_index_clear(git_index *index)
static int create_index_error(int error, const char *msg) static int create_index_error(int error, const char *msg)
{ {
giterr_set(GITERR_INDEX, msg); giterr_set_str(GITERR_INDEX, msg);
return error; return error;
} }
......
...@@ -21,7 +21,7 @@ static int zstream_seterr(git_zstream *zs) ...@@ -21,7 +21,7 @@ static int zstream_seterr(git_zstream *zs)
if (zs->zerr == Z_MEM_ERROR) if (zs->zerr == Z_MEM_ERROR)
giterr_set_oom(); giterr_set_oom();
else if (zs->z.msg) else if (zs->z.msg)
giterr_set(GITERR_ZLIB, zs->z.msg); giterr_set_str(GITERR_ZLIB, zs->z.msg);
else else
giterr_set(GITERR_ZLIB, "Unknown compression error"); giterr_set(GITERR_ZLIB, "Unknown compression error");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment